public void Add(int functionalityId, int roleId) { AppRole role = AppRoleRepository.GetSingle(x => x.Id == roleId); if (role.AppRoleType == AppRoleType.Administrator) { throw new BussinesException(3, ErrorResource.CanNotAddFunctionalityToAdminRole); } if (IsFunctionalityRoleAdded(functionalityId, roleId)) { return; } var entity = new FunctionalityAppRole() { FunctionalityId = functionalityId, AppRoleId = roleId }; FunctionalityAppRoleRepository.Add(entity); }
public object GetFunctionalitiesToAdd(DataSourceLoadOptionsBase loadOptions, int roleId) { return(FunctionalityAppRoleRepository.GetFunctionalitiesToAdd(loadOptions, roleId)); }
public bool IsFunctionalityRoleAdded(int functionalityId, int roleId) { return(FunctionalityAppRoleRepository.Any(x => x.AppRoleId == roleId && x.FunctionalityId == functionalityId)); }
public void Delete(int functionalityRoleId) { FunctionalityAppRoleRepository.DeleteWhere(x => x.Id == functionalityRoleId); }