Package org.apache.jetspeed.services.security

Examples of org.apache.jetspeed.services.security.PortalResource


            // Verify security for the parameter
            boolean canAccess =
                JetspeedSecurity.checkPermission(
                    (JetspeedUser) data.getUser(),
                    new PortalResource(entry),
                    JetspeedSecurity.PERMISSION_CUSTOMIZE);

            if (canAccess)
            {
                // Always set portlet id to "preview" so each preview request gets it from the cache.
View Full Code Here


                // Verify security for the parameter
                boolean canAccess =
                    JetspeedSecurity.checkPermission(
                        (JetspeedUser) data.getUser(),
                        new PortalResource(entry, param),
                        JetspeedSecurity.PERMISSION_CUSTOMIZE);

        // If security does not allow access to specific parameter, allow to provide a fallback parameter
        if (canAccess == false)
                {
View Full Code Here

            }
        }

        if (found!=null)
        {
            PortalResource portalResource = new PortalResource(found);
            try
            {
                JetspeedLink jsLink = JetspeedLinkFactory.getInstance(rundata);
                portalResource.setOwner(jsLink.getUserName());
                JetspeedLinkFactory.putInstance(jsLink);
            }
            catch (Exception e)
            {
                logger.warn(e.toString());
                portalResource.setOwner(null);
            }

            if(!JetspeedSecurity.checkPermission((JetspeedUser) jdata.getUser(),
                                                 portalResource,
                                                 JetspeedSecurity.PERMISSION_CUSTOMIZE))
View Full Code Here

    /**
     * @see JetspeedSecurityService#checkPermission
     */
    public static boolean checkPermission(JetspeedRunData runData, String action, RegistryEntry entry)
    {
      return checkPermission(runData.getJetspeedUser(), new PortalResource(entry), action);
    }
View Full Code Here

        List list = new ArrayList();
        for (Iterator i = Registry.get(regName).listEntryNames(); i.hasNext();)
        {
            RegistryEntry entry = Registry.getEntry(regName, (String)i.next());
            boolean selected = false;
            selected = JetspeedSecurity.checkPermission((JetspeedUser) data.getUser(), new PortalResource(entry), "customize");
            if (selected && !selectHidden)
            {
                selected = !entry.isHidden();
            }
            if (selected && (entry instanceof PortletInfoEntry))
View Full Code Here

    {
        boolean result = true;

        if (profile != null && profile.getRootSet() != null)
        {
            PortalResource portalResource = new PortalResource(profile.getRootSet());
            String owner = null;
            if (profile.getUserName() != null)
            {
                owner = profile.getUserName();
            }
            portalResource.setOwner(owner);

            result = JetspeedSecurity.checkPermission((JetspeedUser) rundata.getUser(),
                                                      portalResource,
                                                      JetspeedSecurity.PERMISSION_CUSTOMIZE);
        }
View Full Code Here

    private ConcreteElement content = null;

    public PortletWrapper(Portlet inner)
    {
        wrappedPortlet = inner;
        portalResource = new PortalResource(wrappedPortlet);
    }
View Full Code Here

    */
    public ConcreteElement getContent(RunData rundata)
    {
        ConcreteElement content = null;
        PortletController controller = getController();
        PortalResource portalResource = new PortalResource(this);

        try
        {
            JetspeedLink jsLink = JetspeedLinkFactory.getInstance(rundata);
            portalResource.setOwner(jsLink.getUserName());
            JetspeedLinkFactory.putInstance(jsLink);
        }
        catch (Exception e)
        {
            logger.warn(e.toString(), e);
            portalResource.setOwner(null);
        }

        if (!JetspeedSecurity.checkPermission((JetspeedUser) rundata.getUser()
                  portalResource, JetspeedSecurity.PERMISSION_VIEW))
        {  
View Full Code Here

     *
     * @param rundata the RunData object for the current request
     */
    public boolean allowCustomize(RunData rundata)
    {
        PortalResource portalResource = new PortalResource(this);
        try
        {
            JetspeedLink jsLink = JetspeedLinkFactory.getInstance(rundata);
            portalResource.setOwner(jsLink.getUserName());
            JetspeedLinkFactory.putInstance(jsLink);
        }
        catch (Exception e)
        {
            logger.warn(e.toString(), e);
            portalResource.setOwner(null);
        }
        JetspeedRunData jdata = (JetspeedRunData) rundata;
        return JetspeedSecurity.checkPermission((JetspeedUser) jdata.getUser(),
                                                portalResource,
                                                JetspeedSecurity.PERMISSION_CUSTOMIZE);
View Full Code Here

        int count = 0;
        for (Enumeration en = portlets.getPortlets(); en.hasMoreElements(); count++)
        {
            Portlet p = (Portlet) en.nextElement();
            PortalResource portalResource = new PortalResource(p);

            // Secure the tabs
            try
            {
                JetspeedLink jsLink = JetspeedLinkFactory.getInstance(rundata);
                portalResource.setOwner(jsLink.getUserName());
                JetspeedLinkFactory.putInstance(jsLink);
            }
            catch (Exception e)
            {
                logger.warn(e.toString(), e);
                portalResource.setOwner(null);
            }
            JetspeedRunData jdata = (JetspeedRunData) rundata;
            boolean hasView = JetspeedSecurity.checkPermission((JetspeedUser) jdata.getUser(),
                                                                portalResource,
                                                                JetspeedSecurity.PERMISSION_VIEW);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.services.security.PortalResource

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.