public UserService(DefaultUserManager userManager, DefaultRoleManager roleManager, IUserContainer userContainer, ISignals signals) { _userManager = userManager; _roleManager = roleManager; _userContainer = userContainer; _signals = signals; Logger = NullLogger.Instance; }
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; }
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); }
public Assertion() { Policy = new List <List <string> >(); PolicyStringSet = new HashSet <string>(); RoleManager = new DefaultRoleManager(0); }
public ProfileController(DefaultRoleManager roleManager) { // _test = testInjection; _roleManager = roleManager; }
public HomeController(ITestInjection testInjection, DefaultRoleManager roleManager) { _test = testInjection; _roleManager = roleManager; }