private void bindRoleActions( IList sysRoles, SecurityTool tool ) {

            IBlock sblock = getBlock( "sysroles" );
            foreach (IRole role in sysRoles) {
                String actions = tool.GetActionStringAll( role );
                sblock.Set( "role.Name", role.Name );
                sblock.Set( "actions", actions );
                sblock.Next();
            }
        }
Exemplo n.º 2
0
 private static void bindCheckBoxList( SecurityTool tool, IBlock sblock, IRole role ) {
     IBlock cbBlock = sblock.GetBlock( "checkboxs" );
     IList checkValues = tool.GetCheckBoxList( role );
     foreach (ActionVo av in checkValues) {
         cbBlock.Set( "a.Name", av.Name );
         cbBlock.Set( "a.Value", av.Value );
         cbBlock.Set( "a.Checked", av.Checked );
         cbBlock.Next();
     }
 }
        public static SecurityTool GetSecurityTool( ISecurity f, MvcContext ctx ) {

            IList forumRoles = ForumRole.GetAll();

            IList ownerRoles;
            if (ctx.owner.obj.GetType() != typeof( Site ))
                ownerRoles = ctx.owner.obj.GetRoles();
            else
                ownerRoles = new ArrayList();

            IList siteRoles = new SiteRoleService().GetRoleAndRank();

            IList allRoles = new RoleMerger()
                .Add( forumRoles )
                .Add( ownerRoles )
                .Add( siteRoles )
                .GetResults();

            SecurityTool tool = new SecurityTool( f, new SecurityAction(), allRoles );
            return tool;
        }
 private static SecurityTool getSecurityTool() {
     SecurityTool tool = new SecurityTool( SiteAdminOperationConfig.Instance, new SiteAdminOperation(), new SiteRoleService().GetAdminRoles() );
     return tool;
 }
Exemplo n.º 5
0
 private SecurityTool getSecurityTool()
 {
     // TODO 注入 apps 动态权限
     SecurityTool tool = new SecurityTool( this, new SiteAdminOperation(), new SiteRoleService().GetAdminRoles() );
     return tool;
 }