Package org.jboss.dashboard.security

Examples of org.jboss.dashboard.security.Policy


    public Object acceptVisit(WorkspaceVisitor visitor) throws Exception {
        visitor.visitPanel(this);

        //Panel permissions
        Policy securityPolicy = SecurityServices.lookup().getSecurityPolicy();
        Map workspacePermissions = securityPolicy.getPermissions(this, WorkspacePermission.class);
        Map panelPermissions = securityPolicy.getPermissions(this, PanelPermission.class);
        Map sectionPermissions = securityPolicy.getPermissions(this, SectionPermission.class);
        Map[] permissions = new Map[]{workspacePermissions, panelPermissions, sectionPermissions};
        for (int i = 0; i < permissions.length; i++) {
            Map permissionMap = permissions[i];
            for (Iterator it = permissionMap.keySet().iterator(); it.hasNext();) {
                Principal principal = (Principal) it.next();
View Full Code Here


    public Object acceptVisit(WorkspaceVisitor visitor) throws Exception {
        visitor.visitSection(this);

        //Visit permissions
        Policy securityPolicy = SecurityServices.lookup().getSecurityPolicy();
        Map workspacePermissions = securityPolicy.getPermissions(this, WorkspacePermission.class);
        Map panelPermissions = securityPolicy.getPermissions(this, PanelPermission.class);
        Map sectionPermissions = securityPolicy.getPermissions(this, SectionPermission.class);
        Map[] permissions = new Map[]{workspacePermissions, panelPermissions, sectionPermissions};
        for (int i = 0; i < permissions.length; i++) {
            Map permissionMap = permissions[i];
            for (Iterator it = permissionMap.keySet().iterator(); it.hasNext();) {
                Principal principal = (Principal) it.next();
View Full Code Here

                        manager.delete(element);
                    }
                }

                // Remove attached section permissions
                Policy policy = SecurityServices.lookup().getSecurityPolicy();
                policy.removePermissions(section);
                policy.save();

                //Reposition other sections and remove this
                List childSections = section.getChildren();
                int childCount = childSections.size();
View Full Code Here

                HibernateTxFragment txFragment = new HibernateTxFragment() {
                    protected void txFragment(Session session) throws Exception {

                        // Remove related permissions
                        Policy policy = SecurityServices.lookup().getSecurityPolicy();
                        policy.removePermissions(instance);
                        policy.save();

                        // Remove panels assigned to workspace's sections.
                        Iterator sectionIt = sections.iterator();
                        while (sectionIt.hasNext()) {
                            Section section = (Section) sectionIt.next();
View Full Code Here

    public Object acceptVisit(WorkspaceVisitor visitor) throws Exception {
        visitor.visitWorkspace(this);

        //Workspace permissions
        Policy policy = SecurityServices.lookup().getSecurityPolicy();
        Map workspacePermissions = policy.getPermissions(this, WorkspacePermission.class);
        Map panelPermissions = policy.getPermissions(this, PanelPermission.class);
        Map sectionPermissions = policy.getPermissions(this, SectionPermission.class);
        Map[] permissions = new Map[]{workspacePermissions, panelPermissions, sectionPermissions};
        for (int i = 0; i < permissions.length; i++) {
            Map permissionMap = permissions[i];
            for (Iterator it = permissionMap.keySet().iterator(); it.hasNext();) {
                Principal principal = (Principal) it.next();
View Full Code Here

    public Object acceptVisit(WorkspaceVisitor visitor) throws Exception {
        visitor.visitPanel(this);

        //Panel permissions
        Policy securityPolicy = SecurityServices.lookup().getSecurityPolicy();
        Map workspacePermissions = securityPolicy.getPermissions(this, WorkspacePermission.class);
        Map panelPermissions = securityPolicy.getPermissions(this, PanelPermission.class);
        Map sectionPermissions = securityPolicy.getPermissions(this, SectionPermission.class);
        Map[] permissions = new Map[]{workspacePermissions, panelPermissions, sectionPermissions};
        for (int i = 0; i < permissions.length; i++) {
            Map permissionMap = permissions[i];
            for (Iterator it = permissionMap.keySet().iterator(); it.hasNext();) {
                Principal principal = (Principal) it.next();
View Full Code Here

                createPermission(result, workspace, workspace, child, attributes);
            }
        }
        workspacesManager.store(workspace);
        //Save the policy, as probably everybody modified it...
        Policy securityPolicy = SecurityServices.lookup().getSecurityPolicy();
        securityPolicy.save();

        result.setObjectCreated(workspace);
    }
View Full Code Here

        principalName = transformPrincipalName(principalName, principalClass, attributes);

        Constructor principalConstructor = Class.forName(principalClass).getConstructor(new Class[]{String.class});
        DefaultPrincipal principal = (DefaultPrincipal) principalConstructor.newInstance(new Object[]{principalName});
        Policy securityPolicy = SecurityServices.lookup().getSecurityPolicy();
        securityPolicy.addPermission(principal, permission, Boolean.valueOf(readonly));
        securityPolicy.save();
    }
View Full Code Here

                createPermission(result, workspace, workspace, child, attributes);
            }
        }
        workspacesManager.store(workspace);
        //Save the policy, as probably everybody modified it...
        Policy securityPolicy = SecurityServices.lookup().getSecurityPolicy();
        securityPolicy.save();

        result.setObjectCreated(workspace);
    }
View Full Code Here

        principalName = transformPrincipalName(principalName, principalClass, attributes);
        permission.setReadOnly(readonly != null && readonly.equals("true"));

        Constructor principalConstructor = Class.forName(principalClass).getConstructor(new Class[]{String.class});
        DefaultPrincipal principal = (DefaultPrincipal) principalConstructor.newInstance(new Object[]{principalName});
        Policy securityPolicy = SecurityServices.lookup().getSecurityPolicy();
        securityPolicy.addPermission(principal, permission);
        securityPolicy.save();
    }
View Full Code Here

TOP

Related Classes of org.jboss.dashboard.security.Policy

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.