CheckUserGlobalPermissions Method
This documentation is archived and is not being maintained.

Security.CheckUserGlobalPermissions Method

Office 2007

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

Namespace:  WebSvcSecurity
Assembly:  ProjectServerWebServices (in ProjectServerWebServices.dll)

[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: []
Array of GUIDs for one or more global permissions.

Return Value

Type: []
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. To check 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

Log on Project Server. Global permission.

The following example checks if the current user has three different 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.
}
. . .
Show:
© 2016 Microsoft