private PswaAuthorizationRuleManager() { string root = "/Users/bruno/Projects/PowerShell/Web/PowershellWebAccess"; this.powwaConfigFilePath = Environment.ExpandEnvironmentVariables(Path.Combine (root, "data/powwa.config.xml")); this.powwaAuthorizationRuleSchemaResourcePath = "Microsoft.Management.PowerShellWebAccess.data.AuthorizationRuleSchema.xsd"; this.powwaConfigFileResourcePath = "Microsoft.Management.PowerShellWebAccess.data.powwa.config.xml"; this.powwaAuthorizationRuleFileResourcePath = "Microsoft.Management.PowerShellWebAccess.data.AuthorizationRules.xml"; this.activeDirectoryHelper = new ActiveDirectoryHelper(); }
private PswaAuthorizationRuleManager() { string root = "/Users/bruno/Projects/PowerShell/Web/PowershellWebAccess"; this.powwaConfigFilePath = Environment.ExpandEnvironmentVariables(Path.Combine(root, "data/powwa.config.xml")); this.powwaAuthorizationRuleSchemaResourcePath = "Microsoft.Management.PowerShellWebAccess.data.AuthorizationRuleSchema.xsd"; this.powwaConfigFileResourcePath = "Microsoft.Management.PowerShellWebAccess.data.powwa.config.xml"; this.powwaAuthorizationRuleFileResourcePath = "Microsoft.Management.PowerShellWebAccess.data.AuthorizationRules.xml"; this.activeDirectoryHelper = new ActiveDirectoryHelper(); }
public PointWriter(IPointReadWriteConfig config, IActiveDirectoryHelper activeDirectoryHelper) { _config = config; _activeDirectoryHelper = activeDirectoryHelper; }
private PowwaAuthorizationManager() { this.userSessionsLimit = PowwaAuthorizationManager.defaultMaxSessionsAllowedPerUser; this.activeDirectoryHelper = new ActiveDirectoryHelper(); }
/// <summary> /// /// </summary> /// <param name="currentUser"></param> /// <param name="user"></param> /// <param name="appID"></param> /// <param name="overrideID"></param> /// <param name="userID"></param> /// <param name="adRoleLookupRepository"></param> /// <returns></returns> /// <remarks>*** THE ONLY ROLE IN AD IS NOW ONE GIVING ACCESS TO THE APPLICATION USED BY LANDING PAGE ***</remarks> public string[] GetUserRoles(string currentUser, string user, string appID, string overrideID, string userID, Guid?applicationCode, IRepository <ADRoleLookup> adRoleLookupRepository, IRepository <StaffAttributes> staffAttributesRepository, IActiveDirectoryHelper activeDirectoryHelper) { try { // Create instance of Staff repository. Note - no way to specify user guids Guid staffCodeGuid = Guid.Parse(userID); //#if DEBUG // string[] adGroups = new string[] { "DWP-FW-ADMIN", "DWP-FW-APPLICATION", "DWP-UCB-APPLICATION", "DWP-DMACR-APPLICATION","DWP-BCAS-APPLCIATION" }; //#else // Get list of AD groups for user string[] adGroups = activeDirectoryHelper.GetADGroups(userID); //#endif // Get roles for AD groups string[] MatchingRoles = GetApplicationRolesForADGroups(currentUser, user, appID, overrideID, applicationCode, adGroups, adRoleLookupRepository); //***************************CHANGE TO GET ROLES FROM STAFF ATTRIBUTES******************************** //*****************THE ONLY ROLE IN AD IS NOW ONE GIVING ACCESS TO THE APPLICATION USED BY LANDING PAGE******************** List <StaffAttributes> attributes = staffAttributesRepository.Find(new Specification <StaffAttributes>(x => x.ApplicationAttribute.IsRole && x.LookupValue == "Yes" && x.StaffCode == staffCodeGuid), x => x.ApplicationAttribute.AttributeName, "ApplicationAttribute", "Application").ToList(); MatchingRoles = MatchingRoles.Concat <string>(attributes.Select(x => x.ApplicationAttribute.AttributeName)).ToArray(); return(MatchingRoles); } catch (Exception e) { //Prevent exception from propogating across the service interface ExceptionManager.ShieldException(e); return(null); } }