Exemplo n.º 1
0
        public void Initialize()
        {
            _authorizationService = new AbilityAuthorizationService();
            _adminRole = new Role("Administrator");
            _user = new User("User");
            _adminAbilities = new List<Ability>
                {
                    new Ability("Ability1"),
                    new Ability("Ability2")
                };

            Ability abilityThree = new Ability("Ability3");

            HeroConfig.Initialize(_authorizationService);
            HeroConfig.RegisterAbilities(_adminRole, _adminAbilities);
            HeroConfig.RegisterAbility(_adminRole, abilityThree);
            HeroConfig.RegisterRole(_user, _adminRole);
        }
Exemplo n.º 2
0
 public static void Initialize(IAbilityAuthorizationService authorizationService)
 {
     AuthorizationService = authorizationService;
 }