public void AddSecurableObject(ISecurableObject securableObject) { SecurableObject obj = new SecurableObject() { Application = securableObject.Application, SecurableObjectType = securableObject.SecurableObjectType, Guid = securableObject.SecurableObjectGuid }; GatekeeperFactory.SecurableObjectSvc.Add(obj); }
public void Save(Application application, User user, Role role, SecurableObject securableObject) { UserRoleAssignmentDao uraDao = new UserRoleAssignmentDao(); //long securableObjectId = new SecurableObjectDao().GetId(securableObject.SecurableObjectGuid); UserRoleAssignment ura = uraDao.Get(application, user, securableObject); if (ura == null) { ura = new UserRoleAssignment() { Application = application, User = user, Role = role, SecurableObjectId = securableObject.Id }; uraDao.Add(ura); } else { ura.Role = role; uraDao.Update(ura); } }
public UserRoleAssignment Get(Application application, User user, SecurableObject securableObject) { UserRoleAssignment ura = this.userRoleAssignmentDao.Get(application, user, securableObject); this.PopulateDetails(ura); return ura; }