Security.CheckUserProjectPermission Method
Checks whether the current user has the specified security category permission for a specified project.
Namespace: WebSvcSecurity
Assembly: ProjectServerWebServices (in ProjectServerWebServices.dll)
Syntax
'Declaration
<SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/Security/CheckUserProjectPermission", 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 CheckUserProjectPermission ( _
projectUid As Guid, _
categoryPermissionUid As Guid _
) As Boolean
'Usage
Dim instance As Security
Dim projectUid As Guid
Dim categoryPermissionUid As Guid
Dim returnValue As Boolean
returnValue = instance.CheckUserProjectPermission(projectUid, _
categoryPermissionUid)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/office/project/server/webservices/Security/CheckUserProjectPermission", 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 CheckUserProjectPermission(
Guid projectUid,
Guid categoryPermissionUid
)
Parameters
- projectUid
Type: System.Guid
GUID of a project.
- categoryPermissionUid
Type: System.Guid
GUID of a category permission.
Return Value
Type: System.Boolean
true if the current user has the category permission for the project.
Remarks
CheckUserProjectPermission wraps a call to CheckUserObjectPermission. To check multiple category permissions for a project, use CheckUserProjectPermissions for better performance. To check a category permission for another user on a project requires using impersonation to log on as that user.
For the categoryPermissionUid parameter, use the PSSecurityCategoryPermission structure to get the GUID for one of the default category permissions, or use ReadCategoryPermissions to get the GUID for a custom category permission.
Project Server Permissions
Permission |
Description |
---|---|
Log on Project Server. Global permission. |
Examples
The following example checks if the current user has the "Delete Project" permission for an existing project. For additional information and a complete sample application, see Using Security Methods in the PSI.
[C#]
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;
// Set the GUID for an existing project.
Guid projectUid = new Guid("a1fcbf91-e91d-44e2-a4a7-3b4b698cb984");
Guid categoryPermission = PSLibrary.PSSecurityCategoryPermission.DeleteProject;
bool hasDeleteProjectPermission =
security.CheckUserProjectPermission(projectUid, categoryPermission);
. . .
See Also
Reference
Other Resources
Using Security Methods in the PSI
Walkthrough: Creating and Using Custom Project Server Permissions