Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.UserACL$Permission


        PortalRequestContext pcontext = Util.getPortalRequestContext();
        DataStorage dataStorage = getApplicationComponent(DataStorage.class);

        PortalConfig pConfig = dataStorage.getPortalConfig(pcontext.getPortalOwner());
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        UserACL acl = (UserACL) container.getComponentInstanceOfType(UserACL.class);

        UIFormInputSet uiSettingSet = new UIFormInputSet("PageSetting");
        uiSettingSet.addUIFormInput(new UIFormStringInput("pageId", "pageId", null).setReadOnly(true));

        List<SelectItemOption<String>> ownerTypes = new ArrayList<SelectItemOption<String>>();
        if (pConfig != null && acl.hasEditPermission(pConfig)) {
            ownerTypes.add(new SelectItemOption<String>(SiteType.PORTAL.getName()));
        }

        UserPortalConfigService userPortalConfigService = getApplicationComponent(UserPortalConfigService.class);
        List<String> groups = userPortalConfigService.getMakableNavigations(pcontext.getRemoteUser(), true);
View Full Code Here


                uiApp.addMessage(new ApplicationMessage("UIMembershipList.msg.InUse", null));
                return;
            }

            // Check to see whether given membershiptype is mandatory or not
            UserACL acl = uiMembership.getApplicationComponent(UserACL.class);
            List<String> mandatories = acl.getMandatoryMSTypes();
            if (!mandatories.isEmpty() && mandatories.contains(name)) {
                UIApplication uiApp = event.getRequestContext().getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIMembershipList.msg.DeleteMandatory", null));
                return;
            }
View Full Code Here

        return orgService;
    }

    public static UserACL getUserACL() {
        ExoContainer container = ExoContainerContext.getCurrentContainer();
        UserACL acl = (UserACL) container.getComponentInstanceOfType(UserACL.class);
        return acl;
    }
View Full Code Here

    public static class DeleteUserActionListener extends EventListener<UIListUsers> {
        public void execute(Event<UIListUsers> event) throws Exception {
            UIListUsers uiListUser = event.getSource();
            String userName = event.getRequestContext().getRequestParameter(OBJECTID);
            OrganizationService service = uiListUser.getApplicationComponent(OrganizationService.class);
            UserACL userACL = uiListUser.getApplicationComponent(UserACL.class);
            if (userACL.getSuperUser().equals(userName)) {
                UIApplication uiApp = event.getRequestContext().getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIListUsers.msg.DeleteSuperUser", new String[] { userName },
                        ApplicationMessage.WARNING));
                return;
            }
View Full Code Here

            if (groupForm.getGroupId() != null) {
                uiApp.addMessage(new ApplicationMessage("UIGroupManagement.msg.Delete", null));
                return;
            }
            OrganizationService service = uiGroupManagement.getApplicationComponent(OrganizationService.class);
            UserACL acl = uiGroupManagement.getApplicationComponent(UserACL.class);
            List<String> mandatories = acl.getMandatoryGroups();
            if (!mandatories.isEmpty() && isMandatory(service.getGroupHandler(), currentGroup, mandatories)) {
                uiApp.addMessage(new ApplicationMessage("UIGroupManagement.msg.DeleteMandatory", null));
                return;
            }
            String parentId = currentGroup.getParentId();
View Full Code Here

            UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
            String pageId = node.getPageRef();
            // Page page = (pageId != null) ? service.getPage(pageId) : null;
            PageContext page = (pageId != null) ? service.getPageService().loadPage(PageKey.parse(pageId)) : null;
            if (page != null) {
                UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
                if (!userACL.hasPermission(page)) {
                    uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.UserNotPermission", new String[] { pageId }, 1));
                    return;
                }
            }
View Full Code Here

                        return;
                    }
                }
            }

            UserACL userACL = uiForm.getApplicationComponent(UserACL.class);

            String ownerId = uiForm.getOwner();
            String[] accessPermission = new String[1];
            accessPermission[0] = "*:" + ownerId;
            String editPermission = userACL.getMakableMT() + ":" + ownerId;

            if (SiteType.PORTAL.equals(uiForm.getOwnerType())) {
                UIPortal uiPortal = Util.getUIPortal();
                accessPermission = uiPortal.getAccessPermissions();
                editPermission = uiPortal.getEditPermission();
View Full Code Here

            // get selected page
            String pageId = node.getPageRef();
            PageContext pageContext = (pageId != null) ? userService.getPageService().loadPage(PageKey.parse(pageId)) : null;
            if (pageContext != null) {
                UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
                if (!userACL.hasEditPermission(pageContext)) {
                    uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.UserNotPermission", new String[] { pageId }, 1));
                    return;
                }

                uiApp.setModeState(UIPortalApplication.APP_BLOCK_EDIT_MODE);
View Full Code Here

        app.setAccessPermissions(defaultPermission);
    }

    public static void setPermissionToAdminGroup(Application app) {
        ArrayList<String> permissions = new ArrayList<String>();
        UserACL acl = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
        MembershipEntry anyOfAdminGroup = new MembershipEntry(acl.getAdminGroups());
        permissions.add(anyOfAdminGroup.toString());
        app.setAccessPermissions(permissions);
    }
View Full Code Here

        String remoteUser = pcontext.getRemoteUser();
        if (remoteUser == null) {
            return false;
        }

        UserACL userACL = this.getApplicationComponent(UserACL.class);
        if (userACL.isUserInGroup(userACL.getAdminGroups())) {
            return true;
        }

        OrganizationService orgService = this.getApplicationComponent(OrganizationService.class);
        try {
            Collection<?> groups = orgService.getGroupHandler().findGroupByMembership(remoteUser, userACL.getMakableMT());
            return groups != null && groups.size() > 0;
        } catch (Exception ex) {
            return false;
        }
    }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.UserACL$Permission

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.