Security.CheckUserGlobalPermissions Method

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

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

Syntax

'Declaration
<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 Function CheckUserGlobalPermissions ( _
    globalPermissionUids As Guid() _
) As Boolean()
'Usage
Dim instance As Security
Dim globalPermissionUids As Guid()
Dim returnValue As Boolean()

returnValue = instance.CheckUserGlobalPermissions(globalPermissionUids)
[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.

Remarks

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.

Examples

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.
}
. . .

See Also

Reference

Security Class

Security Members

WebSvcSecurity Namespace

Other Resources

Using Security Methods in the PSI

Walkthrough: Creating and Using Custom Project Server Permissions