Security.CheckUserGlobalPermissions Method

Checks whether the current user has one or more of the specified global permissions.

Namespace:  [Security Web service]
Service reference: http://ServerName:32843/[Project Service Application GUID]/PSI/Security.svc
Web service reference: http://ServerName/ProjectServerName/_vti_bin/PSI/Security.asmx?wsdl

[SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/Security/CheckUserGlobalPermissions", RequestNamespace = "http://schemas.microsoft.com/office/project/server/webservices/Security/", 
	ResponseNamespace = "http://schemas.microsoft.com/office/project/server/webservices/Security/", 
	Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public bool[] CheckUserGlobalPermissions(
	Guid[] globalPermissionUids
)

Parameters

globalPermissionUids
Type: []
An array of unique identifiers for one or more global permissions.

Return Value

Type: []
An array of Boolean values for each value in the globalPermissionUids parameter.

Use the plural CheckUserGlobalPermissions method for better performance than CheckUserGlobalPermission when you check for multiple global permissions. Checking a security permission for another resource requires using impersonation to log on as that resource.

For GUID values in the globalPermissionUids parameter, use the PSSecurityCategoryPermission structure to get default global permissions, or use ReadGlobalPermissions to get the GUIDs for custom global permissions.

Project Server Permissions

Permission

Description

LogOn

Allows a user to log on to the Project Server. Global permission.

The following example checks whether the current user has three specific global permissions. For additional information and a complete sample application that checks multiple global permissions, see Using Security Methods in the PSI.

using System;
using System.Net;
using PSLibrary = Microsoft.Office.Project.Server.Library;
. . .
CookieContainer cookiecontainer = new CookieContainer();
SecurityWebSvc.Security security = new SecurityWebSvc.Security();
security.Url = "http://ServerName/ProjectServerName/_vti_bin/psi/security.asmx";
security.CookieContainer = cookiecontainer;
security.Credentials = System.Net.CredentialCache.DefaultCredentials;

Guid[] permissionChecks = { 
      // Permissions for creating resources and security groups:
   PSLibrary.PSSecurityGlobalPermission.NewResource, 
   PSLibrary.PSSecurityGlobalPermission.ManageUsersAndGroups, 
      // Permission for creating security categories:
   PSLibrary.PSSecurityGlobalPermission.ManageSecurity }; 

bool[] permissionResults = new bool[permissionChecks.Length];
permissionResults = security.CheckUserGlobalPermissions(permissionChecks);

bool permissionOk = true;

for (int i = 0; i < permissionResults.Length; i++)
{
   permissionOk = permissionOk && permissionResults[i];
}

if (permissionOk)
{
   // Continue the application.
}
. . .

Community Additions

Show: