public RoleConfigurationValidator(IRoleConfigurationRepository roleConfigurationRepository, IPermissionAccessLevelRepository permissionAccessLevelRepository, IRoleRepository roleRepository, IPermissionRepository permissionRepository, IAccessLevelRepository accessLevelRepository)
        {
            _roleConfigurationRepository     = roleConfigurationRepository;
            _permissionAccessLevelRepository = permissionAccessLevelRepository;
            _roleRepository        = roleRepository;
            _permissionRepository  = permissionRepository;
            _accessLevelRepository = accessLevelRepository;

            RuleSet("Base", () =>
            {
                RuleFor(roleConfiguration => roleConfiguration.RoleId).NotNull().NotEmpty();
                RuleFor(roleConfiguration => roleConfiguration.PermissionId).NotNull().NotEmpty();
                RuleFor(roleConfiguration => roleConfiguration.AccessLevelId).NotNull().NotEmpty();
                Custom(CheckIsAccessLevelBelongToPermission);
                Custom(ReferencesValidate);
            });

            RuleSet("Create", () =>
            {
                Custom(CreateRoleConfigurationValidate);
            });

            RuleSet("Update", () =>
            {
                Custom(UpdateRoleConfigurationValidate);
            });
        }
 public AccesslevelApplication(IAccessLevelRepository accessLevelRepository, ILogger logger)
 {
     _accessLevelRepository = accessLevelRepository;
     _logger = logger;
 }
Exemplo n.º 3
0
 public RoleConfigurationFactory(IRoleRepository roleRepository, IPermissionRepository permissionRepository, IAccessLevelRepository accessLevelRepository)
 {
     _roleRepository        = roleRepository;
     _permissionRepository  = permissionRepository;
     _accessLevelRepository = accessLevelRepository;
 }