Share via


Security.CheckUserGlobalPermission Method

Checks whether the current user has the specified global permission.

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/CheckUserGlobalPermission", 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 CheckUserGlobalPermission ( _
    globalPermissionUid As Guid _
) As Boolean
'Usage
Dim instance As Security
Dim globalPermissionUid As Guid
Dim returnValue As Boolean

returnValue = instance.CheckUserGlobalPermission(globalPermissionUid)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/office/project/server/webservices/Security/CheckUserGlobalPermission", 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 CheckUserGlobalPermission(
    Guid globalPermissionUid
)

Parameters

  • globalPermissionUid
    Type: System.Guid
    Specifies the unique identifier for a global permission.

Return Value

Type: System.Boolean
True if the current user has the permission; otherwise, false.

Remarks

To check multiple global permissions, use CheckUserGlobalPermissions for better performance. To check a security permission for another resource requires using impersonation to log on as that resource.

For the globalPermissionUids parameter, use the PSSecurityCategoryPermission structure to get the GUID value of a default global permission, or use ReadGlobalPermissions to get the GUID for a custom global permission.

Project Server Permissions

Permission

Description

LogOn

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

Examples

The following example checks whether the current user has the "About Project Server" permission. For additional information and a complete sample application that checks 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;

//Check whether the user has the "About Project Server" permission.
bool hasPermission = 
   security.CheckUserGlobalPermission(PSLibrary.PSSecurityGlobalPermission.AboutMicrosoftOfficeProjectServer);
. . .

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