コード例 #1
0
        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;
        }
コード例 #2
0
 public AuthorizeService()
 {
     _securityGroupRepo = new SecurityGroupRepository();
     _userRepo = new UserRepository();
 }
コード例 #3
0
 public UserLogic()
 {
     _userRepo = new UserRepository();
     _securityGroupRepo = new SecurityGroupRepository();
     _cityRepository = new CityRepository();
 }