Package org.jboss.dashboard.security

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


    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", LocaleManager.lookup().localize(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

        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

        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

    private void initSections(Section rootSection, String indent, WorkspaceImpl workspace) {
        if (workspace != null) {
            UserStatus userStatus = UserStatus.lookup();
            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.hasPermission(viewPerm)) {
                    keys.add("" + sections[i].getId());
                    values.add(indent + getTitle(sections[i]));
                    initSections(sections[i], indent + "--", workspace);
                }
View Full Code Here

        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

        if (workspace != null) {
            Section[] sections = rootSection != null ?
                    workspace.getAllChildSections(rootSection.getId()) :
                    workspace.getAllRootSections();
            for (Section section : sections) {
                SectionPermission viewPerm = SectionPermission.newInstance(section, SectionPermission.ACTION_VIEW);
                if (UserStatus.lookup().hasPermission(viewPerm)) {
                    pageIds.add(section.getId());
                    pageTitles.add(indent + getTitle(section));
                    initSections(section, indent + preffix, preffix);
                }
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

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.