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); }
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 }; }