public LayoutController(IUserNavigationManager userNavigationManager, ILocalizationManager localizationManager, ISecurityAppService securityAppService, IMultiTenancyConfig multiTenancyConfig) { _userNavigationManager = userNavigationManager; _localizationManager = localizationManager; _securityAppService = securityAppService; _multiTenancyConfig = multiTenancyConfig; }
public CustomProfileService( ILogger <CustomProfileService> logger, ISecurityAppService securityAppService) { Logger = logger; _securityAppService = securityAppService; }
/// <summary> /// When overridden, provides an entry point for custom authorization checks. /// </summary> /// <param name="httpContext">The HTTP context, which encapsulates all HTTP-specific information about an individual HTTP request.</param> /// <returns> /// true if the user is authorized; otherwise, false. /// </returns> /// <exception cref="T:System.ArgumentNullException">The <paramref name="httpContext"/> parameter is null.</exception> protected override bool AuthorizeCore(HttpContextBase httpContext) { ISecurityAppService securityservice = ObjectFactory.GetInstance <ISecurityAppService>(); IUserAppService userAppService = ObjectFactory.GetInstance <IUserAppService>(); var user = userAppService.GetUserByUserName(httpContext.User.Identity.Name); if (!string.IsNullOrEmpty(Roles)) { foreach (string role in this.Roles.Split(',')) { foreach (var roleViewModel in user.Roles) { if (role.Trim().ToLower().Equals(roleViewModel.Title.Trim().ToLower())) { return(true); } } } } return(false); }
public SecurityController(ISecurityAppService securityAppService) { _securityAppService = securityAppService; }
public PolicyController(ISecurityAppService securityAppService, IPolicyAppService policyAppService) { _securityAppService = securityAppService; _policyAppService = policyAppService; }
public CustomResourceOwnerPasswordValidator(ISecurityAppService authenticationAppService) { _securityAppService = authenticationAppService; }