Adding groups to a project
-
18 Juni 2010 6:42
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,
Semua Balasan
-
18 Juni 2010 12:17Pemilik
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- Disarankan sebagai Jawaban oleh Christophe FiessingerMicrosoft Employee, Owner 18 Juni 2010 12:18
- Ditandai sebagai Jawaban oleh Brian Smith - MSFTMicrosoft Employee, Moderator 01 Juli 2010 22:30
- Tanda sebagai Jawaban dihapus oleh craigmay 25 Oktober 2010 22:27
-
25 Oktober 2010 22:51
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!
-
18 April 2012 3:33
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);