Share via


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

Syntax

'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Security/CheckUserGlobalPermissions", RequestNamespace := "https://schemas.microsoft.com/office/project/server/webservices/Security/",  _
    ResponseNamespace := "https://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("https://schemas.microsoft.com/office/project/server/webservices/Security/CheckUserGlobalPermissions", RequestNamespace = "https://schemas.microsoft.com/office/project/server/webservices/Security/", 
    ResponseNamespace = "https://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.

Remarks

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.

Examples

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 = "https://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

Security Web Service

Other Resources

Using Security Methods in the PSI

Walkthrough: Creating and Using Custom Project Server Permissions