Package org.jboss.dashboard.security

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();
                        request.setAttribute(Parameters.RENDER_PANEL, panel);
View Full Code Here


        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(doGetCurrentWorkspace(), WorkspacePermission.ACTION_LOGIN);
        if (!getUserStatus().hasPermission(workspacePerm)) return false;

        if (getCurrentSectionId() != null) {
            SectionPermission sectionPerm = SectionPermission.newInstance(doGetCurrentSection(), SectionPermission.ACTION_VIEW);
            if (!getUserStatus().hasPermission(sectionPerm)) return false;
        } else {
            // Config is valid when there is no current section, but user can admin workspace.
            WorkspacePermission adminWorkspacePerm = WorkspacePermission.newInstance(doGetCurrentWorkspace(), WorkspacePermission.ACTION_ADMIN);
            if (!getUserStatus().hasPermission(adminWorkspacePerm)) return false;
View Full Code Here

                // No access permission in workspace
                return false;
            }
            Section section = navigationPoint.getPage();
            if (section != null) {
                SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_VIEW);
                if (!getUserStatus().hasPermission(sectionPerm)) {
                    // No access permission in page
                    return false;
                }
                Panel panel = navigationPoint.getPanel();
View Full Code Here

            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

    }

    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

    public void actionPageConfig(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

    }

    public void actionDeleteSection(CommandRequest request) {
        try {
            Section section = ((WorkspaceImpl) getWorkspace()).getSection(new Long(getSelectedSectionId()));
            SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_DELETE);

            if (getUserStatus().hasPermission(sectionPerm)) {
                getSectionsHandler().deleteSection((WorkspaceImpl) getWorkspace(), section);

                this.setDuplicateSection(Boolean.FALSE);
View Full Code Here

    protected void renderSection(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Section section, List visibleIds, List checkedIds, List selectableIds, boolean checkPermissions, boolean showHiddenPages) {

        if (!showHiddenPages && !section.isVisible().booleanValue()) return;

        if (checkPermissions) {
            SectionPermission viewPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_VIEW);
            boolean canView = UserStatus.lookup().hasPermission(viewPerm);
            if (!canView)
                return;
        }

        if (visibleIds != null && !visibleIds.contains(section.getId())) return;
        boolean current = section.equals(NavigationManager.lookup().getCurrentSection());
        setAttribute("current", current);
        renderFragment("sectionStart");
        setAttribute("name", StringEscapeUtils.escapeHtml(getLocalizedValue(section.getTitle())));
        setAttribute("url", UIServices.lookup().getUrlMarkupGenerator().getLinkToPage(section, true));
        setAttribute("id", section.getId());
        setAttribute("current", current);
        setAttribute("isRoot", section.isRoot());
        setAttribute("hasChildren", section.getChildren() != null && !section.getChildren().isEmpty());
        setAttribute("checked", checkedIds == null || checkedIds.contains(section.getId()));
        setAttribute("selectable", selectableIds == null || selectableIds.contains(section.getId()));

        SectionPermission sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT);
        setAttribute("editSection", UserStatus.lookup().hasPermission(sectionPerm));

        sectionPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_EDIT_PERMISSIONS);
        setAttribute("editPermissions", UserStatus.lookup().hasPermission(sectionPerm));
View Full Code Here

        CodeBlockTrace trace = new PanelActionTrace(currentPage, 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();
                        request.getRequestObject().setAttribute(Parameters.RENDER_PANEL, panel);
View Full Code Here

        WorkspacePermission workspacePerm = WorkspacePermission.newInstance(doGetCurrentWorkspace(), WorkspacePermission.ACTION_LOGIN);
        if (!getUserStatus().hasPermission(workspacePerm)) return false;

        if (getCurrentSectionId() != null) {
            SectionPermission sectionPerm = SectionPermission.newInstance(doGetCurrentSection(), SectionPermission.ACTION_VIEW);
            if (!getUserStatus().hasPermission(sectionPerm)) return false;
        } else {
            // Config is valid when there is no current section, but user can admin workspace.
            WorkspacePermission adminWorkspacePerm = WorkspacePermission.newInstance(doGetCurrentWorkspace(), WorkspacePermission.ACTION_ADMIN);
            if (!getUserStatus().hasPermission(adminWorkspacePerm)) return false;
View Full Code Here

TOP

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

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.