Adding groups to a project
-
Friday, June 18, 2010 6:42 AM
G'Day All,
I'm butchering the Sample Proposal that came with the SDK for PS 2010. When the user submits the Proposal summary I want to give specific groups permission to access the project based on the user's department. I've been looking at the PSI and there appears to be some methods in there that might do the trick, but not really sure? Any suggestions appreciated!
Cheers,
All Replies
-
Friday, June 18, 2010 12:17 PMOwner
yes you can use the PSI Security methods to achieve this.
Blog | Facebook | Twitter | Posting is provided "AS IS" with no warranties, and confers no rights.
Project Server TechCenter | Project Developer Center | Project Server Help | Project Product Page- Proposed As Answer by Christophe FiessingerMicrosoft Employee, Owner Friday, June 18, 2010 12:18 PM
- Marked As Answer by Brian Smith - MSFTMicrosoft Employee, Moderator Thursday, July 01, 2010 10:30 PM
- Unmarked As Answer by craigmay Monday, October 25, 2010 10:27 PM
-
Monday, October 25, 2010 10:51 PM
Thanks Christophe,
Can you provide a bit more detail please? I understand that it is possible to use the PSI to achieve this though I'm not sure of the specific methods. I've been looking through the SDK documentation for quite some time but can't find any good examples. I think I should be using the setGroups method passing a SecurityGroupsDataSet but not really sure if this is correct. Basically I want to programmatically replicate the functionality of the webpage "EditProjectPermissions.aspx" but the PSI just seems really convoluted!
-
Wednesday, April 18, 2012 3:33 AM
you can try as below:
1. ReadProjectCategory
WebSvcSecurity.SecurityProjectCategoriesDataSet ds = security.ReadProjectCategory(projectUid);
2. if ds.ProjectCategories.Count > 0
W_CAT_UID = ds.ProjectCategories[0].WSEC_CAT_UID;
WebSvcSecurity.SecurityProjectCategoriesDataSet.UserRelationsRow UserRelaRow = ds.UserRelations.NewUserRelationsRow();
UserRelaRow.RES_UID = resourceUid;
UserRelaRow.WSEC_CAT_UID = W_CAT_UID;
ds.UserRelations.AddUserRelationsRow(UserRelaRow);WebSvcSecurity.SecurityProjectCategoriesDataSet.UserPermissionsRow UserPermisRow = ds.UserPermissions.NewUserPermissionsRow();
UserPermisRow.RES_UID = resourceUid;
UserPermisRow.WSEC_CAT_UID = W_CAT_UID;
UserPermisRow.WSEC_FEA_ACT_UID = PSLibrary.PSSecurityCategoryPermission.OpenProject;
ds.UserPermissions.AddUserPermissionsRow(UserPermisRow);security.UpdateProjectCategories(ds);
3. if ds.ProjectCategories.Count <= 0
W_CAT_UID = Guid.NewGuid();
WebSvcSecurity.SecurityProjectCategoriesDataSet.ProjectCategoriesRow PCateRow = ds.ProjectCategories.NewProjectCategoriesRow();
PCateRow.PROJ_UID = projectUid;
PCateRow.WSEC_CAT_UID = W_CAT_UID;
ds.ProjectCategories.AddProjectCategoriesRow(PCateRow);WebSvcSecurity.SecurityProjectCategoriesDataSet.UserRelationsRow UserRelaRow = ds.UserRelations.NewUserRelationsRow();
UserRelaRow.RES_UID = resourceUid;
UserRelaRow.WSEC_CAT_UID = W_CAT_UID;
ds.UserRelations.AddUserRelationsRow(UserRelaRow);WebSvcSecurity.SecurityProjectCategoriesDataSet.UserPermissionsRow UserPermisRow = ds.UserPermissions.NewUserPermissionsRow();
UserPermisRow.RES_UID = resourceUid;
UserPermisRow.WSEC_CAT_UID = W_CAT_UID;
UserPermisRow.WSEC_FEA_ACT_UID = PSLibrary.PSSecurityCategoryPermission.OpenProject;
ds.UserPermissions.AddUserPermissionsRow(UserPermisRow);security.CreateProjectCategories(ds);