Examples of PortalResource


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

                PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, portlet.getName());
                Parameter param = entry.getParameter(parmName);

                // Verify security for the parameter
                boolean canAccess = JetspeedSecurity.checkPermission((JetspeedUser) data.getUser(),
                                                                     new PortalResource(entry, param),
                                                                     JetspeedSecurity.PERMISSION_CUSTOMIZE);
                Map portletParms = portlet.getPortletConfig().getInitParameters();
                String parmStyle = portlet.getPortletConfig().getInitParameter(parmName + ".style");

                // Add portlet reference
View Full Code Here

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

    private ConcreteElement content = null;

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

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

    {
        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

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

    {
        String result = "true";

        if (actionParam != null && entry != null)
        {
            PortalResource portalResource = new PortalResource(entry, actionParam);

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

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

        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

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

    */
    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

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

     *
     * @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

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

                PortletEntry entry = (PortletEntry) Registry.getEntry(Registry.PORTLET, this.portlet);
                Parameter param = entry.getParameter(this.name);

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

            if (canAccess)
            {
View Full Code Here

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

        assertNotNull( "Have userParameter", userParam);
        userParam.setName("UserParam");
        userParam.setValue("userValue");
        userParam.setSecurity(userSecurity);
        userPortletEntry.addParameter(userParam);
        assertEquals( "Admin user customize access to admin parameter", true, JetspeedPortalAccessController.checkPermission( adminUser, new PortalResource( userPortletEntry, adminParam), JetspeedSecurity.PERMISSION_CUSTOMIZE));
        assertEquals( "Turbine user customize access to admin parameter", false, JetspeedPortalAccessController.checkPermission( turbineUser, new PortalResource( userPortletEntry, adminParam), JetspeedSecurity.PERMISSION_CUSTOMIZE));
        assertEquals( "Admin user customize access to admin parameter", true, JetspeedPortalAccessController.checkPermission( adminUser, new PortalResource( userPortletEntry, userParam), JetspeedSecurity.PERMISSION_CUSTOMIZE));
        assertEquals( "Turbine user customize access to admin parameter", true, JetspeedPortalAccessController.checkPermission( turbineUser, new PortalResource( userPortletEntry, userParam), JetspeedSecurity.PERMISSION_CUSTOMIZE));
       
/*
        RegistryEntry adminEntry = createRegistryEntry( ADMIN_PORTLET, "ST_01.admin");
        RegistryEntry userEntry = createRegistryEntry( USER_PORTLET, "ST_01.user");
        RegistryEntry allEntry = createRegistryEntry( ALL_PORTLET, "ST_01.all");
View Full Code Here

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

            // filter some "system" and hidden parameters
            if (  (!param.isHidden()) && (name.charAt(0)!='_') )
            {
                // check the user role
                if (JetspeedSecurity.checkPermission((JetspeedUser)rundata.getUser(), new PortalResource( entry, param), JetspeedSecurity.PERMISSION_CUSTOMIZE))
                {
                    // Implementation of clone() is missing so we have do it "by hand"
                    Parameter clone = new BaseParameter();
                    clone.setName(param.getName());
                    clone.setTitle(param.getTitle());
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.