Examples of UserACL


Examples of org.exoplatform.portal.config.UserACL

        this.accessPermissions = accessPermissions;
    }

    public boolean hasPermission() {
        ExoContainer exoContainer = ExoContainerContext.getCurrentContainer();
        UserACL acl = (UserACL) exoContainer.getComponentInstanceOfType(UserACL.class);
        for (String per : accessPermissions) {
            if (acl.hasPermission(per)) {
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

                list.add(2, uiForm.groupIdSelectBox);
                String groupIdSelected = uiForm.groupIdSelectBox.getValue();
                groupIdSelected = groupIdSelected.startsWith("/") ? groupIdSelected : "/" + groupIdSelected;
                String permission = "*:" + groupIdSelected;
                uiForm.findFirstComponentOfType(UIListPermissionSelector.class).setValue(new String[] { permission });
                UserACL userACL = uiForm.getApplicationComponent(UserACL.class);
                permission = userACL.getMakableMT() + ":" + groupIdSelected;
                uiForm.findFirstComponentOfType(UIPermissionSelector.class).setValue(permission);
            }
            prContext.addUIComponentToUpdateByAjax(uiForm.getParent());
        }
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

            } else {
                String groupIdSelected = uiForm.groupIdSelectBox.getValue();
                groupIdSelected = groupIdSelected.startsWith("/") ? groupIdSelected : "/" + groupIdSelected;
                String permission = "*:" + groupIdSelected;
                uiForm.findFirstComponentOfType(UIListPermissionSelector.class).setValue(new String[] { permission });
                UserACL userACL = uiForm.getApplicationComponent(UserACL.class);
                permission = userACL.getMakableMT() + ":" + groupIdSelected;
                uiForm.findFirstComponentOfType(UIPermissionSelector.class).setValue(permission);
            }
            event.getRequestContext().addUIComponentToUpdateByAjax(uiForm.getParent());
        }
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

    public void switchToEditMode(Page page) throws Exception {
        WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();

        // check edit permission for page
        UserACL userACL = getApplicationComponent(UserACL.class);
        if (!userACL.hasEditPermission(page)) {
            context.getUIApplication().addMessage(
                    new ApplicationMessage("UIPortalManagement.msg.Invalid-EditPage-Permission", null));
            return;
        }
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

    public void loadGroups() throws Exception {

        PortalRequestContext pContext = Util.getPortalRequestContext();
        UserPortalConfigService dataService = getApplicationComponent(UserPortalConfigService.class);
        UserACL userACL = getApplicationComponent(UserACL.class);
        OrganizationService orgService = getApplicationComponent(OrganizationService.class);
        final List<String> listGroup = new ArrayList<String>();

        // get all group that user has permission
        if (userACL.isUserInGroup(userACL.getAdminGroups()) && !userACL.getSuperUser().equals(pContext.getRemoteUser())) {
            Collection<?> temp = orgService.getGroupHandler().findGroupsOfUser(pContext.getRemoteUser());
            if (temp != null) {
                for (Object group : temp) {
                    Group m = (Group) group;
                    String groupId = m.getId().trim();
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

            String id = event.getRequestContext().getRequestParameter(OBJECTID);
            WebuiRequestContext ctx = event.getRequestContext();
            UIApplication uiApp = ctx.getUIApplication();
            UIPageSelector uiPageSelector = uiPageBrowser.getAncestorOfType(UIPageSelector.class);
            UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasPermission(service.getPageService().loadPage(PageKey.parse(id)))) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.NoPermission", new String[] { id }));
            }
            uiPageSelector.setValue(id);
            // uiPageBrowser.feedDataWithQuery(null);
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

    public static class SaveActionListener extends EventListener<UIPortalForm> {
        public void execute(Event<UIPortalForm> event) throws Exception {
            UIPortalForm uiForm = event.getSource();

            DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
            UserACL acl = uiForm.getApplicationComponent(UserACL.class);
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIPortalApplication uiPortalApp = (UIPortalApplication) prContext.getUIApplication();

            PortalConfig pConfig = dataService.getPortalConfig(uiForm.getPortalOwner());
            if (pConfig != null && acl.hasPermission(pConfig)) {
                UIPortal uiPortal = uiForm.createUIComponent(UIPortal.class, null, null);
                PortalDataMapper.toUIPortal(uiPortal, pConfig);

                uiForm.invokeSetBindingBean(uiPortal);
                // uiPortal.refreshNavigation(localeConfigService.getLocaleConfig(uiPortal.getLocale()).getLocale()) ;
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

        if (depth > 0 && config.path != null && (depth - 1 >= config.path.length || !config.path[depth - 1].equals(name))) {
            return false;
        }

        //
        UserACL acl = userPortal.service.getUserACL();

        // Perform authorization check
        if (config.authorizationMode == UserNodeFilterConfig.AUTH_NO_CHECK) {
            // Do nothing here
        } else {
            if (visibility == Visibility.SYSTEM) {
                if (config.authorizationMode == UserNodeFilterConfig.AUTH_READ_WRITE) {
                    String userName = userPortal.userName;
                    if (!acl.getSuperUser().equals(userName)) {
                        return false;
                    }
                } else {
                    if (!canRead(state)) {
                        return false;
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

    public static class SaveActionListener extends EventListener<UIPortalForm> {
        public void execute(Event<UIPortalForm> event) throws Exception {
            UIPortalForm uiForm = event.getSource();

            DataStorage dataService = uiForm.getApplicationComponent(DataStorage.class);
            UserACL acl = uiForm.getApplicationComponent(UserACL.class);
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIPortalApplication uiPortalApp = (UIPortalApplication) prContext.getUIApplication();

            PortalConfig pConfig = dataService.getPortalConfig(uiForm.getPortalOwner());
            if (pConfig != null && acl.hasPermission(pConfig)) {
                UIPortal uiPortal = uiForm.createUIComponent(UIPortal.class, null, null);
                PortalDataMapper.toUIPortal(uiPortal, pConfig);

                uiForm.invokeSetBindingBean(uiPortal);
                // uiPortal.refreshNavigation(localeConfigService.getLocaleConfig(uiPortal.getLocale()).getLocale()) ;
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

            UIPortal uiPortal = Util.getUIPortal();
            if (SiteType.PORTAL.equals(siteKey.getType())) {
                page.setAccessPermissions(uiPortal.getAccessPermissions());
                page.setEditPermission(uiPortal.getEditPermission());
            } else if (SiteType.GROUP.equals(siteKey.getType())) {
                UserACL acl = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
                String siteName = siteKey.getName().startsWith("/") ? siteKey.getName() : "/" + siteKey.getName();
                page.setAccessPermissions(new String[] { "*:" + siteName });
                page.setEditPermission(acl.getMakableMT() + ":" + siteName);
            }
        }
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.