Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.UserACL


     
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      ExoContainer container = context.getApplication().getApplicationServiceContainer();
      UserPortalConfigService userService =
         (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
      UserACL userACL = (UserACL)container.getComponentInstanceOfType(UserACL.class);

      for (PageNode node : nav.getNodes())
      {
         PageNode newNode = filterNodeNavigation(node, userName, acceptNonDisplayedNode, acceptNodeWithoutPage, userService, userACL);
         if (newNode != null)
View Full Code Here


   {
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      ExoContainer container = context.getApplication().getApplicationServiceContainer();
      UserPortalConfigService userService =
         (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
      UserACL userACL = (UserACL)container.getComponentInstanceOfType(UserACL.class);

      return filterNodeNavigation(node, userName, acceptNonDisplayedNode, userService, userACL);
   }
View Full Code Here

            page.setAccessPermissions(uiPortal.getAccessPermissions());
            page.setEditPermission(uiPortal.getEditPermission());
         }
         else if (PortalConfig.GROUP_TYPE.equals(ownerType))
         {
            UserACL acl = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
            ownerId = ownerId.startsWith("/") ? ownerId : "/" + ownerId;
            page.setAccessPermissions(new String[]{"*:" + ownerId});
            page.setEditPermission(acl.getMakableMT() + ":" + ownerId);
         }        
      }
View Full Code Here

   }

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

        return selectedCategory;
    }

    public final List<ApplicationCategory> getCategories() throws Exception {
        ApplicationRegistryService service = getApplicationComponent(ApplicationRegistryService.class);
        UserACL acl = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);

        String remoteUser = ((WebuiRequestContext) WebuiRequestContext.getCurrentInstance()).getRemoteUser();
        List<ApplicationCategory> listCategories = new ArrayList<ApplicationCategory>();

        Iterator<ApplicationCategory> appCateIte = service.getApplicationCategories(remoteUser, ApplicationType.GADGET)
                .iterator();
        while (appCateIte.hasNext()) {
            ApplicationCategory cate = appCateIte.next();
            for (String p : cate.getAccessPermissions()) {
                if (acl.hasPermission(p)) {
                    List<Application> listGadgets = cate.getApplications();
                    if (listGadgets != null && listGadgets.size() > 0) {
                        listCategories.add(cate);
                        break;
                    }
View Full Code Here

    public void setCategories(final List<ApplicationCategory> categories) {
        this.categories = categories;
    }

    public List<Application> getGadgetsOfCategory(final ApplicationCategory appCategory) {
        UserACL acl = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
        List<Application> listGadgets = new ArrayList<Application>();
        Iterator<Application> gadgetIterator = appCategory.getApplications().iterator();
        while (gadgetIterator.hasNext()) {
            Application app = gadgetIterator.next();
            for (String p : app.getAccessPermissions()) {
                if (acl.hasPermission(p)) {
                    listGadgets.add(app);
                    break;
                }
            }
        }
View Full Code Here

    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

    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

            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

        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

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.