Пример #1
0
        public static bool HasAnonymousAccessCacheFunction(string requestedUrl)
        {
            IViewElementRoleService viewElementRoleService = ServiceBase.DependencyInjectionFactory.CreateInjectionInstance <IViewElementRoleService>();

            //if (appBase.ViewElementsGrantedToAnonymousUser == null)
            //{
            //var userProfileService = ServiceBase.DependencyInjectionFactory.CreateInjectionInstance<IUserProfileService>();
            // var viewElementRoleService = ServiceBase.DependencyInjectionFactory.CreateInjectionInstance<IViewElementRoleService>();

            //  var userProfile = UserProfileService.Filter(entity => entity.Id.Equals(2)).FirstOrDefault();
            // 2 => Anonymous userProfile
            var viewElements = viewElementRoleService.GetViewElementGrantedToUserByUserId(2);

            appBase.ViewElementsGrantedToAnonymousUser = new UserViewElement {
                UserId = 2, ViewElements = viewElements
            };
            //}

            var elementWithAccess = appBase.ViewElementsGrantedToAnonymousUser.ViewElements.FirstOrDefault(element => HasRequestedUrlAccessInViewElement(element, requestedUrl));

            if (elementWithAccess == null)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }
Пример #2
0
 public Authentication(IUserProfileService userProService, ICompanyService companyService,
                       IViewElementService viewElementService, IViewElementRoleService viewElementRoleService, ICompanyChartService companyChartService)
 {
     _userProService         = userProService;
     _companyService         = companyService;
     _viewElementService     = viewElementService;
     _viewElementRoleService = viewElementRoleService;
     _companyChartService    = companyChartService;
 }
Пример #3
0
        public ViewElementService(IDbContextBase dbContextBase, IUserService userService,
                                  IUserProfileService userProfileService, ICompanyChartRoleService companyChartRoleService, IViewElementRoleService viewElementRoleService)
            : base(dbContextBase)
        {
            _repositoryBase = new ViewElementRepository(ContextBase);

            UserService             = userService;
            UserProfileService      = userProfileService;
            CompanyChartRoleService = companyChartRoleService;
            ViewElementRoleService  = viewElementRoleService;
        }
Пример #4
0
        public AccountApiController(IAuthentication formsService, IViewElementRoleService viewElementRoleService, ICompanyChartService CompanyChartService,
                                    IUserService userService, IServiceBase <CoreUserLog> userLogService, IUserProfileService userprofileService, IConstantService constantService, IDomainAuthenticationService domainAuthenticationService)
        {
            _membershipService = new AccountMembership();

            _formsService = formsService;

            _viewElementRoleService      = viewElementRoleService;
            _companyChartService         = CompanyChartService;
            _userService                 = userService;
            _userLogService              = userLogService;
            _userProfileService          = userprofileService;
            _constantService             = constantService;
            _domainAuthenticationService = domainAuthenticationService;
        }
Пример #5
0
        //private ICompanyRoleService _CompanyRoleService;

        public ViewElementRoleController(IViewElementService viewElementService, IViewElementRoleService viewElementRoleService)//, ICompanyRoleService CompanyRoleService)
        {
            _viewElementService     = viewElementService;
            _viewElementRoleService = viewElementRoleService;
            //_CompanyRoleService = CompanyRoleService;
        }
Пример #6
0
 //  private IUserProfileService _userProfileService;
 public PartialViewsController(IViewElementRoleService viewElementRoleService)
 {
     _viewElementRoleService = viewElementRoleService;
     //   _userProfileService = userProfileService;
 }