public bool IsUserInRole(string roleName, string userName) { var securityGroupRepo = new SecurityGroupRepository(); var userRepo = new UserRepository(); var role = securityGroupRepo.GetGroupByTitle(roleName); if (role != null) { var user = userRepo.GetCredentials(userName); if (user != null) return role.sec_gro_id == user.sec_gro_id; } return false; }
public AuthorizeService() { _securityGroupRepo = new SecurityGroupRepository(); _userRepo = new UserRepository(); }
public UserLogic() { _userRepo = new UserRepository(); _securityGroupRepo = new SecurityGroupRepository(); _cityRepository = new CityRepository(); }