Examples of UserACL


Examples of org.exoplatform.portal.config.UserACL

    public static class CreatePortalActionListener extends EventListener<UIWorkingWorkspace> {
        public void execute(Event<UIWorkingWorkspace> event) throws Exception {
            PortalRequestContext prContext = Util.getPortalRequestContext();
            UIPortalApplication uiApp = event.getSource().getAncestorOfType(UIPortalApplication.class);
            UserACL userACL = uiApp.getApplicationComponent(UserACL.class);
            if (!userACL.hasCreatePortalPermission()) {
                uiApp.addMessage(new ApplicationMessage("UIPortalBrowser.msg.Invalid-createPermission", null));
                return;
            }
            UIMaskWorkspace uiMaskWS = uiApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
            UIPortalForm uiNewPortal = uiMaskWS.createUIComponent(UIPortalForm.class, "CreatePortal", "UIPortalForm");
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

        String remoteUser = prContext.getRemoteUser();
        String portalName = prContext.getPortalOwner();

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

        if (!isPortalExist(editPortal)) {
            return;
        }

        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(portalName);
        if (pConfig != null) {
            editPortal.setModifiable(acl.hasEditPermission(pConfig));
        } else {
            editPortal.setModifiable(false);
        }
        LocaleConfigService localeConfigService = uiPortalApp.getApplicationComponent(LocaleConfigService.class);
        LocaleConfig localeConfig = localeConfigService.getLocaleConfig(portalConfig.getLocale());
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

            PortalRequestContext pcontext = (PortalRequestContext) event.getRequestContext();
            UIPortalApplication portalApp = (UIPortalApplication) pcontext.getUIApplication();
            UIPortal currentPortal = portalApp.getCurrentSite();
            UIWorkingWorkspace uiWorkingWS = event.getSource();

            UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermissionOnPortal(currentPortal.getSiteType().getName(), currentPortal.getName(),
                    currentPortal.getEditPermission())) {
                portalApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-EditLayout-Permission",
                        new String[] { currentPortal.getName() }));
                return;
            }
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

        String remoteUser = Util.getPortalRequestContext().getRemoteUser();
        if (remoteUser == null || remoteUser.equals("")) {
            return null;
        }

        UserACL userACL = getApplicationComponent(UserACL.class);

        List<Application> allApps = selectedCategory.getApplications();
        List<Application> apps = new ArrayList<Application>();

        for (Application app : allApps) {
            List<String> accessPermission = app.getAccessPermissions();
            if (accessPermission == null || accessPermission.size() == 0) {
                continue;
            }

            GadgetRegistryService gadgetService = getApplicationComponent(GadgetRegistryService.class);
            for (String p : accessPermission) {
                if (userACL.hasPermission(p)) {
                    if (ApplicationType.GADGET.equals(app.getType())) {
                        try {
                            Gadget gadget;
                            gadget = gadgetService.getGadget(app.getApplicationName());
                            if (gadget != null)
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

        if (remoteUser == null || remoteUser.equals("")) {
            return;
        }

        ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
        UserACL userACL = getApplicationComponent(UserACL.class);

        final Comparator<Application> appComparator = new Comparator<Application>() {
            public int compare(Application p_1, Application p_2) {
                return p_1.getDisplayName().compareToIgnoreCase(p_2.getDisplayName());
            }
        };
        final Comparator<ApplicationCategory> cateComparator = new Comparator<ApplicationCategory>() {
            public int compare(ApplicationCategory p_1, ApplicationCategory p_2) {
                return p_1.getDisplayName(true).compareToIgnoreCase(p_2.getDisplayName(true));
            }
        };

        List<ApplicationCategory> allCategories = service.getApplicationCategories(remoteUser);
        categories = new ArrayList<ApplicationCategory>();

        for (ApplicationCategory category : allCategories) {
            List<Application> apps = category.getApplications();
            List<String> accessPermission = category.getAccessPermissions();
            if (accessPermission == null) {
                continue;
            }

            for (String p : accessPermission) {
                if (userACL.hasPermission(p)) {
                    if (apps.size() > 0) {
                        Collections.sort(apps, appComparator);
                    }
                    categories.add(category);
                    break;
View Full Code Here

Examples of org.exoplatform.portal.config.UserACL

        }
        if (!SiteType.USER.getName().equals(page.getOwnerType())) {
            page.setAccessPermissions(uiPermissionSetting.getChild(UIListPermissionSelector.class).getValue());
            page.setEditPermission(uiPermissionSetting.getChild(UIPermissionSelector.class).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

Examples of org.exoplatform.portal.config.UserACL

        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

Examples of org.exoplatform.portal.config.UserACL

            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

Examples of org.exoplatform.portal.config.UserACL

                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

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.