Esempio n. 1
0
 public UserService(DefaultUserManager userManager, DefaultRoleManager roleManager, IUserContainer userContainer,
                    ISignals signals)
 {
     _userManager   = userManager;
     _roleManager   = roleManager;
     _userContainer = userContainer;
     _signals       = signals;
     Logger         = NullLogger.Instance;
 }
Esempio n. 2
0
        public RoleService(DefaultRoleManager roleManager, ICurrencyService currencyService, IUserContainer userContainer, ICacheManager cacheManager, ISignals signals)
        {
            _roleManager     = roleManager;
            _currencyService = currencyService;
            _userContainer   = userContainer;
            _cacheManager    = cacheManager;
            _signals         = signals;

            Logger = NullLogger.Instance;
        }
Esempio n. 3
0
        public void TestEnforceWithMultipleRoleManager()
        {
            var e = new Enforcer(TestModelFixture.GetNewTestModel(
                                     _testModelFixture._rbacMultipleModelText,
                                     _testModelFixture._rbacMultiplePolicyText));

            var roleManager = new DefaultRoleManager(5);

            roleManager.AddMatchingFunc((arg1, arg2) => arg1.Equals(arg2));
            e.SetRoleManager(roleManager);
            bool result = e.Enforce("@adm-user", "org::customer1", "cust1", "manage");

            Assert.True(result);

            roleManager.AddMatchingFunc((arg1, arg2) => !arg1.Equals(arg2));
            e.SetRoleManager(roleManager);
            result = e.Enforce("@adm-user", "org::customer1", "cust1", "manage");
            Assert.False(result);
        }
Esempio n. 4
0
 public Assertion()
 {
     Policy          = new List <List <string> >();
     PolicyStringSet = new HashSet <string>();
     RoleManager     = new DefaultRoleManager(0);
 }
Esempio n. 5
0
        public ProfileController(DefaultRoleManager roleManager)

        {
            //  _test = testInjection;
            _roleManager = roleManager;
        }
        public HomeController(ITestInjection testInjection, DefaultRoleManager roleManager)

        {
            _test        = testInjection;
            _roleManager = roleManager;
        }