Whenever we create new site in SharePoint site collections its default settings is "SharePoint Permission Mode". But to create Groups, Categories, Security Templates,User Sync Settings,Delegates and so on we require "Project Permission Mode".
So, we can find programmatically the Project web app settings.
1. Add Project Server Interface (PSI)-Security web service reference in your code.
2. Then add below given code
using ProjectName.SecurityWebSvc;
SecurityWebSvc.Security securityWebSvc;
public void CheckProjectWebAppSettings()
{
switch (securityWebSvc.ReadPermissionMode())
{
case SecurityWebSvc.PermissionMode.ProjectServer:
// Permission mode is "Project Permission Mode"
break;
case SecurityWebSvc.PermissionMode.SharePoint:
// Permission mode is "SharePoint Permission Mode"
break;
case SecurityWebSvc.PermissionMode.UninitializedProjectServer:
// Permission mode is "UninitializedProjectServer Permission Mode"
break;
case SecurityWebSvc.PermissionMode.UninitializedSharePoint:
// Permission mode is "UninitializedSharePoint Permission Mode"
break;
}
}
I hope this code will help you.
Thanks
0 Comment(s)