Package org.exoplatform.portal.config

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


            if (page == null) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { id }, 1));
                return;
            }

            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermission(page)) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[] { id }, 1));
                return;
            }

            UIPortal uiPortal = Util.getUIPortal();
View Full Code Here

                uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { id }, 1));
                return;
            }

            // Check current user 's permissions on the page
            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermission(pageContext)) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.edit.NotEditPage", new String[] { id }, 1));
                return;
            }

            // Need this code to override editpage action in extension project
View Full Code Here

        UIPortal uiPortal = Util.getUIPortal();
        String remoteUser = prContext.getRemoteUser();

        PortalConfig portalConfig = (PortalConfig) PortalDataMapper.buildModelObject(editPortal);
        DataStorage dataStorage = getApplicationComponent(DataStorage.class);
        UserACL acl = getApplicationComponent(UserACL.class);

        setEditted(false);

        // Reset tab pane state
        UITabPane tabPane = getChild(UITabPane.class);
        tabPane.setSelectedTab(1);

        uiPortalApp.setSessionOpen(PortalProperties.SESSION_ALWAYS.equals(uiPortal.getSessionAlive()));
        uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
        uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
        prContext.ignoreAJAXUpdateOnPortlets(true);

        if (isPortalExist(editPortal)) {
            SkinService skinService = getApplicationComponent(SkinService.class);
            skinService.invalidatePortalSkinCache(editPortal.getName(), editPortal.getSkin());
            try {
                dataStorage.save(portalConfig);
            } catch (StaleModelException ex) {
                // Temporary solution for concurrency-related issue. The StaleModelException should be
                // caught in the ApplicationLifecycle
                rebuildUIPortal(uiPortalApp, editPortal, dataStorage);
            }
            prContext.getUserPortalConfig().setPortalConfig(portalConfig);
            PortalConfig pConfig = dataStorage.getPortalConfig(uiPortal.getSiteKey().getTypeName(), uiPortal.getSiteKey()
                    .getName());
            if (pConfig != null) {
                editPortal.setModifiable(acl.hasEditPermission(pConfig));
                prContext.getUserPortalConfig().setPortalConfig(pConfig);
            } else {
                editPortal.setModifiable(false);
            }
            LocaleConfigService localeConfigService = uiPortalApp.getApplicationComponent(LocaleConfigService.class);
            LocaleConfig localeConfig = localeConfigService.getLocaleConfig(portalConfig.getLocale());
            if (localeConfig == null) {
                localeConfig = localeConfigService.getDefaultLocaleConfig();
            }
            // TODO dang.tung - change layout when portal get language from UIPortal
            // (user and browser not support)
            // ----------------------------------------------------------------------------------------------------
            String portalAppLanguage = prContext.getLocale().getLanguage();
            OrganizationService orgService = getApplicationComponent(OrganizationService.class);
            UserProfile userProfile = orgService.getUserProfileHandler().findUserProfileByName(remoteUser);
            String userLanguage = userProfile != null ? userProfile.getUserInfoMap().get(Constants.USER_LANGUAGE) : null;
            String browserLanguage = prContext.getRequest().getLocale().getLanguage();

            // in case: edit current portal, set skin and language for uiPortalApp
            if (uiPortal == null) {
                if (!portalAppLanguage.equals(userLanguage) && !portalAppLanguage.equals(browserLanguage)) {
                    prContext.setLocale(localeConfig.getLocale());
                }
                uiPortalApp.setSkin(editPortal.getSkin());
            }
            prContext.refreshResourceBundle();

            UISiteBody siteBody = uiWorkingWS.findFirstComponentOfType(UISiteBody.class);
            uiPortal = (UIPortal) siteBody.getUIComponent();
            if (uiPortal == null) {
                siteBody.setUIComponent(editPortal);
            }
            uiEditWS.setRendered(false);
            uiPortal = (UIPortal) siteBody.getUIComponent();

            // Update the cache of UIPortal from UIPortalApplication
            uiPortalApp.refreshCachedUI();

            UserNode currentNode = uiPortal.getSelectedUserNode();
            SiteKey siteKey = currentNode.getNavigation().getKey();
            PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(uiPortalApp,
                    PageNodeEvent.CHANGE_NODE, siteKey, currentNode.getURI());
            uiPortalApp.broadcast(pnevent, Event.Phase.PROCESS);

            if (!acl.hasPermission(portalConfig) && editPortal.getName().equals(prContext.getPortalOwner())) {
                logout(prContext);
            } else {
                prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
                Util.updatePortalMode();
            }
View Full Code Here

            uiAccessPermissionSelector.addValidator(EmptyIteratorValidator.class);
            uiPermissionSetting.addChild(uiAccessPermissionSelector);
            uiPermissionSetting.setSelectedComponent(uiAccessPermissionSelector.getId());

            ExoContainer container = ExoContainerContext.getCurrentContainer();
            UserACL acl = container.getComponentInstanceOfType(UserACL.class);
            if(acl.isSuperUser() || acl.isUserInGroup(acl.getAdminGroups())) {
                //Move permission
                UIListPermissionSelector uiMoveAppsPermissionSelector = createUIComponent(UIListPermissionSelector.class, null, "MoveAppsPermissions");
                uiMoveAppsPermissionSelector.configure(WebuiRequestContext.generateUUID("UIListMoveAppsPermissionSelector"), "moveAppsPermissions");
                uiPermissionSetting.addChild(uiMoveAppsPermissionSelector);
View Full Code Here

            UIWorkingWorkspace uiWorkingWS = uiPortalApp.findFirstComponentOfType(UIWorkingWorkspace.class);
            UIEditInlineWorkspace uiEditWS = uiWorkingWS.getChild(UIEditInlineWorkspace.class);
            UIPortal editPortal = (UIPortal) uiEditWS.getUIComponent();

            PortalConfig portalConfig = (PortalConfig) PortalDataMapper.buildModelObject(editPortal);
            UserACL acl = uiComposer.getApplicationComponent(UserACL.class);
            if (!acl.hasPermission(portalConfig)) {
                uiEditWS.createActionConfirm("UIEditInlineWorkspace.confirm.finish.site", "ConfirmFinish", "AbortClose");
            } else {
                uiComposer.saveSite();
            }
        }
View Full Code Here

        this.moveContainersPermissions = moveContainersPermissions;
    }

    public boolean hasMoveContainersPermission() {
        ExoContainer exoContainer = ExoContainerContext.getCurrentContainer();
        UserACL acl = (UserACL) exoContainer.getComponentInstanceOfType(UserACL.class);
        return acl.hasPermission(moveContainersPermissions);
    }
View Full Code Here

        this.moveAppsPermissions = moveAppsPermissions;
    }

    public boolean hasMoveAppsPermission() {
        ExoContainer exoContainer = ExoContainerContext.getCurrentContainer();
        UserACL acl = (UserACL) exoContainer.getComponentInstanceOfType(UserACL.class);
        return acl.hasPermission(moveAppsPermissions);
    }
View Full Code Here

            }
            if(uiMoveContainersPermissionSelector != null) {
                page.setMoveContainersPermissions(uiMoveContainersPermissionSelector.getValue());
            }
        }
        UserACL userACL = getApplicationComponent(UserACL.class);
        userACL.hasPermission(page);

        UIFormInputItemSelector<?> uiTemplate = getChildById("Template");
        if (uiTemplate != null) {
            SelectItemOption<?> itemOption = uiTemplate.getSelectedItemOption();
            if (itemOption != null) {
View Full Code Here

        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

TOP

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

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.