示例#1
0
        public IEnumerable <string> GetWindowsUserRoles(string userName)
        {
            var identity = ObjectIdentity.Parse(userName);

            var user = _activeDirectoryRepository.GetUser(identity.Name, identity.DomainName);

            return((user == null) ? new string[0] : user.Groups);
        }
示例#2
0
        public ActiveDirectoryGroupMapper()
        {
            var config = SiemplifyConfigServiceBL.Instance.GetManagementServerConfiguration();

            _adminMapping = new ActiveDirectoryGroupMapping()
            {
                Group   = ObjectIdentity.Parse(config.AdminGroupName),
                AppRole = UserRoleEnum.Admin
            };

            _analystMapping = new ActiveDirectoryGroupMapping()
            {
                Group   = ObjectIdentity.Parse(config.AnalystGroupName),
                AppRole = UserRoleEnum.Analyst
            };
        }