private CreateGroupAssociation ( int groupId ) : void | ||
groupId | int | The ID of the Group object |
리턴 | void |
private void CopyGroupAssociationsToRootMap(GlymaSecurableObject rootMapSecurableObject) { SPSecurity.RunWithElevatedPrivileges(delegate() { using (IGlymaSession glymaSession = new WebAppSPGlymaSession(this.WebUrl)) { using (IDbConnectionAbstraction connectionAbstraction = glymaSession.ConnectionFactory.CreateSecurityDbConnection()) { using (SecurityServiceDataContext dataContext = new SecurityServiceDataContext(connectionAbstraction.Connection)) { var groupAssociations = from ga in dataContext.GroupAssociations where ga.SecurableObjectUid == rootMapSecurableObject.SecurableParentUid select ga; if (groupAssociations.Any()) { foreach (GroupAssociation groupAssociation in groupAssociations) { GlymaSecurableObject securableObject = new GlymaSecurableObject(); securableObject.SecurableParentUid = groupAssociation.SecurableObjectUid; //the parent is now the project uid securableObject.SecurableObjectUid = rootMapSecurableObject.SecurableObjectUid; //the object is now the root map being copied to GlymaSecurityAssociationContext securityAssocationContext = new GlymaSecurityAssociationContext(this, rootMapSecurableObject); securityAssocationContext.CreateGroupAssociation(groupAssociation.GroupId); } } } } } }); }
private void CopyGroupAssociationsToRootMap(GlymaSecurableObject rootMapSecurableObject) { SPSecurity.RunWithElevatedPrivileges(delegate() { using (IGlymaSession glymaSession = new WebAppSPGlymaSession(this.WebUrl)) { using (IDbConnectionAbstraction connectionAbstraction = glymaSession.ConnectionFactory.CreateSecurityDbConnection()) { using (SecurityServiceDataContext dataContext = new SecurityServiceDataContext(connectionAbstraction.Connection)) { var groupAssociations = from ga in dataContext.GroupAssociations where ga.SecurableObjectUid == rootMapSecurableObject.SecurableParentUid select ga; if (groupAssociations.Any()) { foreach (GroupAssociation groupAssociation in groupAssociations) { GlymaSecurableObject securableObject = new GlymaSecurableObject(); securableObject.SecurableParentUid = groupAssociation.SecurableObjectUid; //the parent is now the project uid securableObject.SecurableObjectUid = rootMapSecurableObject.SecurableObjectUid; //the object is now the root map being copied to GlymaSecurityAssociationContext securityAssocationContext = new GlymaSecurityAssociationContext(this, rootMapSecurableObject); securityAssocationContext.CreateGroupAssociation(groupAssociation.GroupId); } } } } } }); }