Examples of SectionPermission


Examples of org.jboss.dashboard.security.SectionPermission

        navigateToConfigPath(getParsedValue(section.getParent() != null ? childPageConfigPath : pageConfigPath));
    }

    public void actionPageConfigFromTree(CommandRequest request, WorkspaceImpl workspace) throws Exception {
        Section section = workspace.getSection(new Long(request.getParameter("id")));
        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);
        getUserStatus().checkPermission(sectionPerm);
        setWorkspaceValuesFromTree(workspace, section, null);
        navigateToConfigPath(getParsedValue(pageConfigPath));
    }
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

        if (workspace != null) {
            Section[] sections = workspace.getAllSections(); //Sorted!
            for (int i = 0; i < sections.length; i++) {
                Section section = sections[i];
                int depth = section.getDepthLevel();
                SectionPermission viewPerm =
                        SectionPermission.newInstance(sections[i], SectionPermission.ACTION_VIEW);
                if (UserStatus.lookup().hasPermission(viewPerm)) {
                    pages.add(section);
                    String title = getTitle(sections[i]);
                    pageTitles.add(StringUtils.leftPad(title, title.length() + (depth * preffix.length()), preffix));
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

            else if (section != null) {
                try {
                    if (!section.equals(navigationManager.getCurrentSection())) {

                        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(section.getWorkspace(), WorkspacePermission.ACTION_LOGIN);
                        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_VIEW);
                        if (userStatus.hasPermission(workspacePerm) && userStatus.hasPermission(sectionPerm)) {
                            if (log.isDebugEnabled()) log.debug("SessionManager.setSection(" + section.getId() + ")");
                            navigationManager.setCurrentSection(section);
                        }
                        else {
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

        if (workspace != null) {
            Section[] sections = workspace.getAllSections(); //Sorted!
            for (int i = 0; i < sections.length; i++) {
                Section section = sections[i];
                int depth = section.getDepthLevel();
                SectionPermission viewPerm = SectionPermission.newInstance(sections[i], SectionPermission.ACTION_VIEW);
                if (UserStatus.lookup().hasPermission(viewPerm)) {
                    pages.add(section);
                    String title = getTitle(sections[i]);
                    pageTitles.add(StringUtils.leftPad(title, title.length() + (depth * preffix.length()), preffix));
                } else { // Skip all following pages with larger depth (children)
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

        if (workspace != null) {
            Section[] sections = rootSection != null ?
                    workspace.getAllChildSections(rootSection.getId()) :
                    workspace.getAllRootSections();
            for (int i = 0; i < sections.length; i++) {
                SectionPermission viewPerm = SectionPermission.newInstance(sections[i], SectionPermission.ACTION_VIEW);
                if (UserStatus.lookup().hasPermission(viewPerm)) {
                    pageIds.add(sections[i].getId());
                    pageTitles.add(indent + getTitle(sections[i]));
                    initSections(sections[i], indent + preffix, preffix);
                }
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

    }

    public void actionGoToPagePermissions(CommandRequest request) throws Exception {
        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
        Section section = workspace.getSection(new Long(getSelectedSectionId()));
        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);

        if (getUserStatus().hasPermission(sectionPerm)) {
            TreeNode currentNode = getTreeStatus().getLastEditedNode(getConfigTree());
            StringBuffer path = new StringBuffer();
            path.append(currentNode.getPath()).append("/").append(getSectionIds(section));
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

    public NavigationManager getNavigationManager() {
        return NavigationManager.lookup();
    }

    public synchronized void deleteSection(final WorkspaceImpl workspace, final Section section) {
        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_DELETE);
        try {
            if (getUserStatus().hasPermission(sectionPerm)) {
                NavigationManager navigationManager = getNavigationManager();
                if (navigationManager.getCurrentSectionId() != null) {
                    if (navigationManager.getCurrentSectionId().equals(section.getDbid())) {
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

        }

        if (kpi != null && currentPanel != null) {
            // Check security constraints
            PanelPermission panelPerm = PanelPermission.newInstance(currentPanel, PanelPermission.ACTION_VIEW);
            SectionPermission sectionPerm = SectionPermission.newInstance(currentPanel, SectionPermission.ACTION_VIEW);
            WorkspacePermission workspacePermission = WorkspacePermission.newInstance(currentPanel, WorkspacePermission.ACTION_LOGIN);
            if (!userStatus.hasPermission(panelPerm) || !userStatus.hasPermission(sectionPerm) || !userStatus.hasPermission(workspacePermission)) {
                // Forbidden access response
                setResponse(new SendErrorResponse(HttpServletResponse.SC_FORBIDDEN));
            }
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

        CodeBlockTrace trace = new PanelActionTrace(panel, pAction).begin();
        try {
            WorkspacePermission workspacePerm = WorkspacePermission.newInstance(panel.getWorkspace(), WorkspacePermission.ACTION_LOGIN);
            if (UserStatus.lookup().hasPermission(workspacePerm)) {
                SectionPermission sectionPerm = SectionPermission.newInstance(panel.getSection(), SectionPermission.ACTION_VIEW);
                if (UserStatus.lookup().hasPermission(sectionPerm)) {
                    PanelProvider provider = panel.getInstance().getProvider();
                    if (provider.isEnabled()) {
                        PanelDriver handler = provider.getDriver();
                        CommandResponse response = handler.execute(panel, getRequest());
View Full Code Here

Examples of org.jboss.dashboard.security.SectionPermission

    }

    public void actionGoToPagePermissions(CommandRequest request) throws Exception {
        WorkspaceImpl workspace = (WorkspaceImpl) getWorkspace();
        Section section = workspace.getSection(new Long(getSelectedSectionId()));
        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);

        if (getUserStatus().hasPermission(sectionPerm)) {
            TreeNode currentNode = getTreeStatus().getLastEditedNode(getConfigTree());
            StringBuffer path = new StringBuffer();
            path.append(currentNode.getPath()).append("/").append(getSectionIds(section));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.