Beispiel #1
0
        void OnCreateRole(object sender, EventArgs e)
        {
            IRoleManager roleManager = UserManagerProviderFactory.CreateRoleManager(); // new AspNetSqlProviderService(m_Url);

            string[]           roles  = roleManager.GetAllRoles(m_Application);
            Predicate <string> exists = delegate(string role)
            {
                return(role == m_RoleTextBox.Text);
            };

            if (Array.Exists(roles, exists))
            {
                m_RoleValidator.SetError(m_RoleTextBox, "Role already exists");
                return;
            }
            m_RoleValidator.Clear();
            if (m_RoleTextBox.Text == String.Empty)
            {
                m_RoleValidator.SetError(m_RoleTextBox, "Role cannot be empty");
                return;
            }
            m_RoleValidator.Clear();
            roleManager.CreateRole(m_Application, m_RoleTextBox.Text);
            m_Roles.Add(m_RoleTextBox.Text);
            m_CreatedRolesListView.AddItem(m_RoleTextBox.Text, true);
            m_RoleTextBox.Focus();
            m_RoleTextBox.Text = String.Empty;
        }
Beispiel #2
0
        public Startup ConfigureEvents()
        {
            Bot client = Container.Get <Bot>();

            IUserManager    userManager    = Container.Get <IUserManager>();
            IRoleManager    roleManager    = Container.Get <IRoleManager>();
            IChannelManager channelManager = Container.Get <IChannelManager>();
            IGuildManager   guildManager   = Container.Get <IGuildManager>();

            client.ChannelCreated   += channelManager.OnChannelCreatedAsync;
            client.ChannelDestroyed += channelManager.OnChannelDestroyedAsync;
            client.ChannelUpdated   += channelManager.OnChannelUpdatedAsync;

            client.GuildMemberUpdated += guildManager.OnGuildMemberUpdatedAsync;
            client.GuildUpdated       += guildManager.OnGuildUpdatedAsync;

            client.RoleCreated += roleManager.OnRoleCreatedAsync;
            client.RoleDeleted += roleManager.OnRoleDeletedAsync;
            client.RoleUpdated += roleManager.OnRoleUpdatedAsync;

            client.Ready        += () => userManager.OnClientReadyAsync(client.Guilds);
            client.JoinedGuild  += userManager.OnClientJoinedGuildAsync;
            client.UserBanned   += userManager.OnUserBannedAsync;
            client.UserJoined   += userManager.OnUserJoinedAsync;
            client.UserLeft     += userManager.OnUserLeftAsync;
            client.UserUnbanned += userManager.OnUserUnbannedAsync;
            client.UserUpdated  += userManager.OnUserUpdatedAsync;

            return(this);
        }
Beispiel #3
0
 public RoleController(
     IRoleManager roleManager
     , IRoleRepository roleRepository)
 {
     _roleManager    = roleManager;
     _roleRepository = roleRepository;
 }
 public LoginController(IAccountManager iAccountManager,
                        IRoleAccountManager iRoleAccountManager, IRoleManager iRoleManager)
 {
     _iAccountManager     = iAccountManager;
     _iRoleAccountManager = iRoleAccountManager;
     _iRoleManager        = iRoleManager;
 }
Beispiel #5
0
 public RoleService(
     IRoleRepository roleRepository,
     IRoleManager roleManager)
 {
     _roleRepository = roleRepository;
     _roleManager    = roleManager;
 }
Beispiel #6
0
        void OnDeleteRole(object sender, EventArgs e)
        {
            DialogResult result = MessageBox.Show("Are you sure you want to delete the role " + RoleName + " ?", "Credentials Manager", MessageBoxButtons.OKCancel);

            if (result == DialogResult.OK)
            {
                IRoleManager roleManager = UserManagerProviderFactory.CreateRoleManager(); // new AspNetSqlProviderService(ServiceAddress);
                try
                {
                    bool deleted = roleManager.DeleteRole(ApplicationName, RoleName, m_ThrowIfPopulatedCheckBox.Checked);
                    if (deleted == false)
                    {
                        MessageBox.Show("Encountered an error trying to delete role " + m_RolesListView.CurrentListViewItem, "Credentials Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        m_RolesListView.RemoveItem(RoleName);
                        RefreshUsersForRoleComboBox();
                        RefreshRolesForUserComboBox();
                        RefreshRolePageButtons();
                    }
                }
                catch (SoapException exception)
                {
                    if (exception.Message.Contains("This role cannot be deleted because there are users present in it"))
                    {
                        MessageBox.Show("Failed to delete role " + m_RolesListView.CurrentListViewItem + " because it was populated.", "Credentials Manager", MessageBoxButtons.OK, MessageBoxIcon.Error);
                    }
                    else
                    {
                        throw;
                    }
                }
            }
        }
Beispiel #7
0
 public RolesController(IRoleManager roleManager, IUserManager userManager,
                        IMapper mapper)
     : base(mapper)
 {
     _roleManager = roleManager;
     _userManager = userManager;
 }
Beispiel #8
0
 /// <summary>
 /// 初始化角色服务
 /// </summary>
 /// <param name="unitOfWork">工作单元</param>
 /// <param name="roleRepository">角色仓储</param>
 /// <param name="roleManager">角色服务</param>
 public RoleService(IGreatWallUnitOfWork unitOfWork, IRoleRepository roleRepository, IRoleManager roleManager)
     : base(unitOfWork, roleRepository)
 {
     UnitOfWork     = unitOfWork;
     RoleRepository = roleRepository;
     RoleManager    = roleManager;
 }
Beispiel #9
0
 /// <summary>
 /// 构造器
 /// </summary>
 /// <param name="context"></param>
 /// <param name="userRoleManager"></param>
 /// <param name="userManager"></param>
 /// <param name="roleManager"></param>
 public UserRolesController(ApplicationDbContext context, IUserRoleManager userRoleManager, IUserManager <UserJson> userManager, IRoleManager <RoleJson> roleManager)
 {
     _context        = context;
     UserRoleManager = userRoleManager;
     UserManager     = userManager;
     RoleManager     = roleManager;
 }
Beispiel #10
0
        public Client(IRoleManager manager)
        {
            var user = manager.GetUser();
            var role = manager.GetRoles(user);

            manager.DoSomething();
        }
 /// <summary>
 /// 初始化角色服务
 /// </summary>
 /// <param name="unitOfWork">工作单元</param>
 /// <param name="roleManager">角色服务</param>
 /// <param name="roleRepository">角色仓储</param>
 public RoleService(ISampleUnitOfWork unitOfWork, IRoleManager roleManager, IRoleRepository roleRepository)
     : base(unitOfWork, roleRepository)
 {
     UnitOfWork     = unitOfWork;
     RoleManager    = roleManager;
     RoleRepository = roleRepository;
 }
Beispiel #12
0
        internal static void TestGetRolesWithDomain(IRoleManager roleManager, string name, string domain, List <string> expectResult)
        {
            List <string> result  = roleManager.GetRoles(name, domain);
            string        message = $"{name}: {result}, supposed to be {expectResult}";

            Assert.True(Utility.SetEquals(expectResult, result), message);
        }
Beispiel #13
0
        public void BuildRoleLinks(IRoleManager roleManager)
        {
            RoleManager = roleManager;
            int count = Value.ToCharArray().Count(x => x == '_');

            foreach (var rule in Policy)
            {
                if (count < 2)
                {
                    throw new Exception("the number of \"_\" in role definition should be at least 2");
                }
                if (rule.Count < count)
                {
                    throw new Exception("grouping policy elements do not meet role definition");
                }

                if (count == 2)
                {
                    roleManager.AddLink(rule[0], rule[1]);
                }
                else if (count == 3)
                {
                    roleManager.AddLink(rule[0], rule[1], rule[2]);
                }
                else if (count == 4)
                {
                    roleManager.AddLink(rule[0], rule[1], rule[2], rule[3]);
                }
            }
        }
Beispiel #14
0
 public UserController(IUserManager usrManager, IRoleManager roleManager, ILogger <UserController> log, UserManager <ApplicationUser> userManager)
 {
     this.usrManager  = usrManager;
     this.roleManager = roleManager;
     _userManager     = userManager;
     _log             = log;
 }
Beispiel #15
0
        internal static AbstractFunction GenerateGFunction(string name, IRoleManager rm)
        {
            bool Call(string arg1, string arg2, string domain = null)
            {
                if (rm == null)
                {
                    return(arg1.Equals(arg2));
                }
                else
                {
                    bool res;
                    if (!String.IsNullOrEmpty(domain))
                    {
                        res = rm.HasLink(arg1, arg2, domain);
                        return(res);
                    }

                    res = rm.HasLink(arg1, arg2);
                    return(res);
                }
            }

            GCall call = Call;

            return(new AviatorFunction(name, call));
        }
Beispiel #16
0
        void OnRemoveUserFromRole(object sender, EventArgs e)
        {
            string role = m_RolesListView.CurrentListViewItem;

            Debug.Assert(!String.IsNullOrEmpty(role));
            IRoleManager roleManager = UserManagerProviderFactory.CreateRoleManager(); // new AspNetSqlProviderService(ServiceAddress);
            IUserManager userManager = roleManager as IUserManager;

            Debug.Assert(userManager != null);

            if (userManager.IsInRole(ApplicationName, UserToAssign, role))
            {
                DialogResult result = MessageBox.Show("Are you sure you want to remove the user " + UserToAssign + " from the role " + m_RolesListView.CurrentListViewItem + " ?", "Credentials Manager", MessageBoxButtons.OKCancel);
                if (result == DialogResult.OK)
                {
                    roleManager.RemoveUserFromRole(ApplicationName, UserToAssign, role);
                    RefreshRolesForUserComboBox();
                    RefreshUsersForRoleComboBox();
                    RefreshRolePageButtons();
                }
            }
            else
            {
                MessageBox.Show("The user " + UserToAssign + " is not a member of the role " + m_RolesListView.CurrentListViewItem, "Credentials Manager", MessageBoxButtons.OKCancel, MessageBoxIcon.Error);
            }
        }
Beispiel #17
0
 public InvoiceRowItemAdapter(Context context, IRoleManager roleManager) : base(context, roleManager, Resource.Layout.InvoiceRowItem)
 {
     DeleteVisibility = roleManager.Permissions.ContainsKey(Resource.Id.InvoiceRowItemDelete) ? ViewStates.Visible : ViewStates.Invisible;
     ReadVisibility   = roleManager.Permissions.ContainsKey(Resource.Id.InvoiceRowItemInfo) ? ViewStates.Visible : ViewStates.Invisible;
     _styleProvider   = ColorConditionalStyleProvider.Instance;
     _itemsFormat     = _context.Resources.GetString(Resource.String.InvoiceEntries);
 }
 public GoodsDispatchedNotesAdapter(Context context, IRoleManager roleManager)
     : base(context, roleManager, Resource.Layout.GoodsDispatchedNotesRowItem)
 {
     DeleteVisibility = roleManager.Permissions.ContainsKey(Resource.Id.GoodsDispatchedNoteRowItemDelete) ? ViewStates.Visible : ViewStates.Invisible;
     ReadVisibility   = roleManager.Permissions.ContainsKey(Resource.Id.GoodsDispatchedNoteRowItemInfo) ? ViewStates.Visible : ViewStates.Invisible;
     _styleProvider   = ColorConditionalStyleProvider.Instance;
 }
Beispiel #19
0
        // This method gets called by the runtime. Use this method to configure the HTTP request pipeline.
        public void Configure(IApplicationBuilder app,
                              IHostingEnvironment env,
                              IServiceProvider serviceProvider,
                              IRoleManager roleManager)
        {
            if (env.IsDevelopment())
            {
                app.UseBrowserLink();
                app.UseDeveloperExceptionPage();
                app.UseDatabaseErrorPage();
            }
            else
            {
                app.UseExceptionHandler("/Home/Error");
            }

            app.UseRequestLocalization();

            app.UseStaticFiles();

            app.UseAuthentication();

            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });

            //CreateRoles(serviceProvider, roleManager).Wait();
        }
Beispiel #20
0
 public UserController()
 {
     _userManager = new UserManager();
     _roleManager = new RoleManager();
     _postManager = new PostManager();
     _deptManager = new DeptManager();
 }
        public AuthorizationDialog(string url, string application, string user) : this()
        {
            m_Url = url;
            m_ApplicationTextBox.Text = application;
            m_UserComboBox.Text       = user;

            IRoleManager roleManager = UserManagerProviderFactory.CreateRoleManager();

            string[] roles = roleManager.GetRolesForUser(application, user);

            m_RoleComboBox.Items.AddRange(roles);
            if (roles.Length > 0)
            {
                m_RoleComboBox.Text = roles[roles.Length - 1];
            }

            IMembershipManager membershipManager = roleManager as IMembershipManager;

            string[] users = membershipManager.GetAllUsers(application);

            m_UserComboBox.Items.AddRange(users);
            if (users.Length > 0)
            {
                m_UserComboBox.Text = users[users.Length - 1];
            }
        }
Beispiel #22
0
 public void testSetup()
 {
     _roleMock    = new RoleAccessorMock();
     _roleManager = new RoleManager(_roleMock);
     _roles       = new List <Role>();
     _roles       = _roleManager.RetrieveAllRoles();
 }
Beispiel #23
0
 public OwnersController(ApplicationDbContext context, IUserHelper userHelper,
                         ICurrentUserFactory currentUser, IRoleManager roleManager) : base(context, userHelper, currentUser)
 {
     _roleManager = roleManager;
     _userHelper  = userHelper;
     recordHelper = new RecordsHelper(context);
 }
Beispiel #24
0
       // private UserInfo userInfo = new UserInfo();

        public AuthorityManager()
        {
            //
            //TODO: 在此处添加构造函数逻辑
            //
            //TcpClientChannel channel = new TcpClientChannel();
            //ChannelServices.RegisterChannel(channel, false);

            //string strRBPCServiceURL = ConfigurationManager.AppSettings["RBPC.Service.url"].ToString();
            //string strRBPCServicePort = ConfigurationManager.AppSettings["RBPC.Service.port"].ToString();
            string strRBPCServiceURL = ConfigurationManager.AppSettings["RBPCServiceAddress"].ToString();
            string strRBPCServicePort = ConfigurationManager.AppSettings["RBPCServicePort"].ToString();
            //string tcpChannel = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/";


            string strAccountMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IAccountManager";
            log.Debug("*-*-strAccountMgrURL=" + strAccountMgrURL);
            string strPermissionMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IPermissionManager";
            log.Debug("*-*-strPermissionMgrURL=" + strPermissionMgrURL);
            string strRoleMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IRoleManager";
            log.Debug("*-*-strRoleMgrURL=" + strRoleMgrURL);
            string strSecurityMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/ISecurityManager";
            log.Debug("*-*-strSecurityMgrURL=" + strSecurityMgrURL);


            accountMgr = (IAccountManager)Activator.GetObject(typeof(IAccountManager), strAccountMgrURL);
            permissionMgr = (IPermissionManager)Activator.GetObject(typeof(IPermissionManager), strPermissionMgrURL);
            roleMgr = (IRoleManager)Activator.GetObject(typeof(IRoleManager), strRoleMgrURL);
            securityMgr = (ISecurityManager)Activator.GetObject(typeof(ISecurityManager), strSecurityMgrURL);
            application = System.Configuration.ConfigurationManager.AppSettings.Get("RBPCApplication").ToString();

        }
Beispiel #25
0
        private void InitializeInterpreter()
        {
            Dictionary <String, AbstractFunction> functions = new Dictionary <string, AbstractFunction>();

            foreach (var entry in fm.FunctionDict)
            {
                String key      = entry.Key;
                var    function = entry.Value;
                functions.Add(key, function);
            }

            if (model.Model.ContainsKey("g"))
            {
                foreach (var entry in model.Model["g"])
                {
                    String       key = entry.Key;
                    Assertion    ast = entry.Value;
                    IRoleManager rm  = ast.RM;
                    functions.Add(key, BuiltInFunctions.GenerateGFunction(key, rm));
                }
            }
            _interpreter = new Interpreter();
            foreach (var func in functions)
            {
                _interpreter.SetFunction(func.Key, func.Value);
            }
            _parsedExpression = null;
        }
Beispiel #26
0
 public MermberManager(IUserInfoService userInfoService,
                       IUserTicketService userTicketService,
                       IUserClientTypeQueryService userClientTypeQueryService,
                       IPowerManager powerManager,
                       IRoleManager roleManager,
                       ICacheManager cacheManager,
                       IUserPowerStore userPowerStore,
                       IMemberPowerStore memberPowerStore,
                       IMemberQueryService memberQueryService,
                       IMemberAppService memberAppService,
                       IConLogQueryService conLogQueryService,
                       IAuthRankQueryService authRankQueryService) :
     base(userInfoService,
          userTicketService,
          userClientTypeQueryService,
          powerManager,
          roleManager,
          cacheManager,
          userPowerStore,
          memberAppService,
          conLogQueryService,
          authRankQueryService)
 {
     _memberPowerStore   = memberPowerStore;
     _memberQueryService = memberQueryService;
 }
Beispiel #27
0
 /// <summary>
 /// 初始化一个<see cref="AdministratorService"/>类型的实例
 /// </summary>
 /// <param name="unitOfWork">工作单元</param>
 /// <param name="administratorManager">管理员管理</param>
 /// <param name="roleManager">角色管理</param>
 public AdministratorService(IAdminUnitOfWork unitOfWork
                             , IAdministratorManager administratorManager
                             , IRoleManager roleManager)
 {
     UnitOfWork           = unitOfWork;
     AdministratorManager = administratorManager;
     RoleManager          = roleManager;
 }
Beispiel #28
0
 public RoleManagerTest()
 {
     roleRequest             = new RoleRequest();
     roleRequest.RoleId      = ROLE_ID;
     roleRequest.Description = ROLE_DESCRIPTION;
     mockRoleRepository      = new StubRoleRepository();
     roleManager             = new RoleManager(mockRoleRepository);
 }
 public UserController(IUserManager userManager, IRoleManager roleManager, IArticleManager articleManager, ILogger.ILogger logger, ICommentManager comManager)
 {
     this.userManager = userManager;
     this.roleManager = roleManager;
     this.articleManager = articleManager;
     this.logger = logger;
     this.comManager = comManager;
 }
Beispiel #30
0
 public UserController(IUserManager userManager, IRoleManager roleManager, IArticleManager articleManager, ILogger.ILogger logger, ICommentManager comManager)
 {
     this.userManager    = userManager;
     this.roleManager    = roleManager;
     this.articleManager = articleManager;
     this.logger         = logger;
     this.comManager     = comManager;
 }
Beispiel #31
0
 public AppEnvironment(IKeyManager keyManager, IServiceManager serviceManager, IRoleManager roleManager, IApiManager apiManager, IStringLocalizer <IAppEnvironment> stringLocalizer)
 {
     _keyManager      = keyManager;
     _serviceManager  = serviceManager;
     _roleManager     = roleManager;
     _apiManager      = apiManager;
     _stringLocalizer = stringLocalizer;
 }
        public LibraryManager()
        {
            _roleManager  = new RoleManager();
            _userManager  = new UserManager(_roleManager);
            _itemsManager = new RentItemsManager();

            _rentalSystem = new RentalManager();
        }
Beispiel #33
0
 public AuthorityManager()
 {
     permissionManager = RBPCAgent.getRBPCManager<IPermissionManager>();
     securityManager = RBPCAgent.getRBPCManager<ISecurityManager>();
     roleManager = RBPCAgent.getRBPCManager<IRoleManager>();
     accountManager = RBPCAgent.getRBPCManager<IAccountManager>();
     appName = ConfigurationManager.AppSettings["RBPCApplication"].ToString();
 }
 public RoleBasedAuthorizationService(
     IPermissionDefinitionManager permissionDefinitionManager,
     IRoleManager roleManager,
     IUserRoleManager userRoleManager)
 {
     _permissionDefinitionManager = permissionDefinitionManager;
     _roleManager = roleManager;
     _userRoleManager = userRoleManager;
     Logger = NullLogger.Instance;
 }
        public GroupService(IMembershipDataSource dataSource, IGroupManager groupManager, IUserManager userManager, IRoleManager roleManager)
        {
            if (!StrixMembership.Configuration.UseGroups)
            {
                throw new InvalidOperationException(Resources.Interface.GroupsNotEnabed);
            }

            this._dataSource = dataSource;
            this._groupManager = groupManager;
            this._userManager = userManager;
            this._roleManager = roleManager;
        }
 public AccountService(
     IMembershipDataSource dataSource,
     ISecurityManager securityManager,
     IUserManager userManager,
     IRoleManager roleManager,
     IMembershipMailer mailer)
 {
     this._dataSource = dataSource;
     this._securityManager = securityManager;
     this._userManager = userManager;
     this._roleManager = roleManager;
     this._mailer = mailer;
 }
        public RoleManagerMock()
        {
            _dataSourceMock.RegisterData<Application>(new List<Application> { MembershipTestData.Application });
            _dataSourceMock.RegisterData<Role>(MembershipTestData.Roles);
            _dataSourceMock.RegisterData<User>(MembershipTestData.Users);
            _dataSourceMock.RegisterData<Group>(MembershipTestData.Groups);
            _dataSourceMock.RegisterData<GroupInRole>(MembershipTestData.GroupsInRoles);
            _dataSourceMock.RegisterData<UserInRole>(MembershipTestData.UsersInRoles);

            _dataSourceMock.Mock.Setup(m => m.Find<GroupInRole>(It.IsAny<object[]>())).Returns<object[]>(p => _dataSourceMock.DataList<GroupInRole>().FirstOrDefault(r => r.GroupId == (Guid)p[0] && r.RoleId == (Guid)p[1]));
            _dataSourceMock.Mock.Setup(m => m.Find<UserInRole>(It.IsAny<object[]>())).Returns<object[]>(p => _dataSourceMock.DataList<UserInRole>().FirstOrDefault(r => r.GroupRoleGroupId == (Guid)p[0] && r.GroupRoleRoleId == (Guid)p[1] && r.UserId == (Guid)p[2]));

            _roleManager = new RoleManager(_dataSourceMock.Mock.Object);
        }
Beispiel #38
0
 public AdminController(
     IAuthorizationService authorizationService,
     ITypeFeatureProvider typeFeatureProvider,
     ISession session,
     IStringLocalizer<AdminController> stringLocalizer,
     ISiteService siteService,
     IShapeFactory shapeFactory,
     IRoleManager roleManager,
     IEnumerable<IPermissionProvider> permissionProviders
     )
 {
     _typeFeatureProvider = typeFeatureProvider;
     _permissionProviders = permissionProviders;
     _roleManager = roleManager;
     _shapeFactory = shapeFactory;
     _siteService = siteService;
     T = stringLocalizer;
     _authorizationService = authorizationService;
     _session = session;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="UserController"/> class.
 /// </summary>
 /// <param name="userManager">The user manager to inject.</param>
 /// <param name="roleManager">The role manager to inject.</param>
 /// <param name="logService">The log service to inject.</param>
 public UserController(IUserManager userManager, IRoleManager roleManager, ILogService logService)
 {
     _userManager = userManager;
     _roleManager = roleManager;
     _logService = logService;
 }
Beispiel #40
0
        public AuthorityManager(string strEditorID)
        {
            string strRBPCServiceURL = ConfigurationManager.AppSettings["RBPCServiceAddress"].ToString();
            string strRBPCServicePort = ConfigurationManager.AppSettings["RBPCServicePort"].ToString();


            string strAccountMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IAccountManager";
            string strPermissionMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IPermissionManager";
            string strRoleMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IRoleManager";
            string strSecurityMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/ISecurityManager";


            accountMgr = (IAccountManager)Activator.GetObject(typeof(IAccountManager), strAccountMgrURL);
            permissionMgr = (IPermissionManager)Activator.GetObject(typeof(IPermissionManager), strPermissionMgrURL);
            roleMgr = (IRoleManager)Activator.GetObject(typeof(IRoleManager), strRoleMgrURL);
            securityMgr = (ISecurityManager)Activator.GetObject(typeof(ISecurityManager), strSecurityMgrURL);
            application = System.Configuration.ConfigurationManager.AppSettings.Get("RBPCApplication").ToString();
            // TODO: Complete member initialization
            editorID = Int64.Parse(strEditorID);
        }
Beispiel #41
0
        public AuthorityManager(UserInfo ui)
            : this()
        {
            string strRBPCServiceURL = ConfigurationManager.AppSettings["RBPCServiceAddress"].ToString();
            string strRBPCServicePort = ConfigurationManager.AppSettings["RBPCServicePort"].ToString();


            string strAccountMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IAccountManager";
            string strPermissionMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IPermissionManager";
            string strRoleMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/IRoleManager";
            string strSecurityMgrURL = "tcp://" + strRBPCServiceURL + ":" + strRBPCServicePort + "/ISecurityManager";


            accountMgr = (IAccountManager)Activator.GetObject(typeof(IAccountManager), strAccountMgrURL);
            permissionMgr = (IPermissionManager)Activator.GetObject(typeof(IPermissionManager), strPermissionMgrURL);
            roleMgr = (IRoleManager)Activator.GetObject(typeof(IRoleManager), strRoleMgrURL);
            securityMgr = (ISecurityManager)Activator.GetObject(typeof(ISecurityManager), strSecurityMgrURL);
            application = System.Configuration.ConfigurationManager.AppSettings.Get("RBPCApplication").ToString();
            editorID = ui.AccountId;//31989
        }
Beispiel #42
0
 public void InititalizeTests()
 {
     mockRoleManager = new Mock<RoleManager<ApplicationRole>>();
     target = new ProomRoleManager(mockRoleManager.Object);
 }
 public RoleService(IMembershipDataSource dataSource, IRoleManager roleManager)
 {
     this._dataSource = dataSource;
     this._roleManager = roleManager;
 }
Beispiel #44
0
 public RolesService(IRoleManager roleManager, IMessageBusService messageBusService, IAuditService auditService)
 {
     _roleManager = roleManager;
     _messageBusService = messageBusService;
     _auditService = auditService;
 }
		public AdministratorSecurityChecker(IWebContext context, IRoleManager manager, IConfigurationReader configurationReader)
		{
			_context = context;
			_manager = manager;
			_configurationReader = configurationReader;
		}