Examples of SecurityReference


Examples of org.apache.jetspeed.om.SecurityReference

        assertEquals(meta.getImage(), "/images/image.gif");
        assertEquals(meta.getDescription(), "This is the big kahuna meta portlet");
        assertEquals(meta.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getName(), "BigKahuna");           
        assertEquals(entry.getParent(), null);
        SecurityReference ref = entry.getSecurityRef();
        assertNotNull(ref);
        assertEquals(ref.getParent(), "admin-only");
        assertEquals(entry.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getType(), PortletEntry.TYPE_ABSTRACT);               
        assertEquals(entry.getURL(), "http://bigkahuna.org");
       
        // parameters
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

        assertEquals(meta.getImage(), "/images/image.gif");
        assertEquals(meta.getDescription(), "new description");
        assertEquals(meta.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getName(), "BigKahuna");           
        assertEquals(entry.getParent(), null);
        SecurityReference ref = entry.getSecurityRef();
        assertNotNull(ref);
        assertEquals(ref.getParent(), "admin-only");
        assertEquals(entry.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getType(), PortletEntry.TYPE_ABSTRACT);               
        assertEquals(entry.getURL(), "http://bigkahuna.org");
       
        // parameters
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

        assertEquals(meta.getImage(), "/images/image.gif");
        assertEquals(meta.getDescription(), "This is the big kahuna meta portlet");
        assertEquals(meta.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getName(), "BigKahunaRef");           
        assertEquals(entry.getParent(), "BigKahuna");
        SecurityReference ref = entry.getSecurityRef();
        assertNotNull(ref);
        assertNull(ref.getParent());
        assertEquals(entry.getTitle(), "The Kahuna Portlet");
        assertEquals(entry.getType(), PortletEntry.TYPE_REF);               
        assertNull(entry.getURL());
       
        // parameters
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

                meta.setDescription("This is the big kahuna meta portlet");
                meta.setTitle("The Meta Kahuna Portlet");
                entry.setMetaInfo(meta);
                entry.setName("BigKahuna");           
                entry.setParent(null);
                SecurityReference ref = new BaseSecurityReference();
                ref.setParent("admin-only");
                entry.setSecurityRef(ref);
                entry.setTitle("The Kahuna Portlet");
                entry.setType(PortletEntry.TYPE_ABSTRACT);               
                entry.setURL("http://bigkahuna.org");
                   
                // parameters
                entry.addParameter("simple", "simple-value");
               
                CachedParameter param = new BaseCachedParameter();
                param.setDescription("pdescription");
                param.setHidden(false);
                meta = new BaseMetaInfo();
                meta.setDescription("meta desc");
                meta.setImage("meta image");
                meta.setTitle("meta title");
                param.setMetaInfo(meta);
                param.setName("coconut");               
                SecurityReference ref2 = new BaseSecurityReference();
                ref2.setParent("admin-only");               
                param.setSecurityRef(ref2);
                param.setTitle("Coconut");
                param.setType("hmm");
                param.setValue("hawaii");
                entry.addParameter(param);
                param.setCachedOnName(true);
                param.setCachedOnValue(false);

               
                param = new BaseCachedParameter();
                param.setDescription("second pdescription");
                param.setHidden(true);
                meta = new BaseMetaInfo();
                meta.setDescription("second meta desc");
                meta.setImage("second meta image");
                meta.setTitle("second meta title");
                param.setMetaInfo(meta);
                param.setName("second coconut");
                SecurityReference ref3 = new BaseSecurityReference();
                ref3.setParent("second admin-only");               
                param.setSecurityRef(ref3);
                param.setTitle("second Coconut");
                param.setType("second hmm");
                param.setValue("second hawaii");
                entry.addParameter(param);
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

            {
                SecurityEntry securityEntry = (SecurityEntry) securityIterator.next();
                if (securityEntry.getName().equals("wide_open") == true)
                {
                    entryFound = true;
                    SecurityReference securityReference = securityEntry.getSecurityRef();
                    assertNotNull("Security entry 'wide_open' has a SecurityReference", securityReference);
                    assertEquals("Got parent", "admin_only", securityReference.getParent());
                }
            }
            assertTrue("Found wide_open security entry", entryFound);

            // Test the use_only entry
            entryFound = false;
            for (securityIterator = securityEntries.iterator(); securityIterator.hasNext();)
            {
                SecurityEntry securityEntry = (SecurityEntry) securityIterator.next();
                if (securityEntry.getName().equals("user_only") == true)
                {
                    entryFound = true;
                    SecurityReference securityReference = securityEntry.getSecurityRef();
                    assertNull("Security entry 'user_open' has no SecurityReference", securityReference);
                }
            }
            assertEquals("Found user_only security entry", true, entryFound);
        }
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

        PortletEntry pEntry = null;
        if (entry != null)
        {
            pEntry = (PortletEntry) Registry.getEntry(Registry.PORTLET, entry.getParent());
        }
        SecurityReference securityRef = null;
        // First, check the profile level security
        if (entry != null)
        {
            securityRef = entry.getSecurityRef();
        }
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

        pe.setMetaInfo(meta);               
        pe.setName(pde.getName());           
        pe.setParent(pde.getParent());
        if(pde.getSecurityRef() != null)
        {
            SecurityReference ref = new BaseSecurityReference();
            ref.setParent(pde.getSecurityRef());
            pe.setSecurityRef(ref);
        }

        pe.setTitle(pde.getTitle());
        pe.setType(pde.getType());
        pe.setURL(pde.getURL());
       
        // parameters
        Iterator params = pde.getPortletParameters().iterator();
        while (params.hasNext())
        {
            PortletParameter pp = (PortletParameter)params.next();
            CachedParameter cp = new BaseCachedParameter(pp.getId());
            cp.setCachedOnName(pp.getCachedOnName());
            cp.setCachedOnValue(pp.getCachedOnValue());
            cp.setDescription(pp.getDescription());
            cp.setHidden(pp.getHidden());
            cp.setName(pp.getName());
            cp.setType(pp.getType());
            cp.setValue(pp.getValue());

           
            cp.setTitle(pp.getTitle());
            if (pp.getDescription() != null || pp.getTitle() != null || pp.getImage() != null)
            {
                MetaInfo meta2 = new BaseMetaInfo();
                meta2.setImage(pp.getImage());
                meta2.setDescription(pp.getDescription());
                meta2.setTitle(pp.getTitle());
                cp.setMetaInfo(meta2);
            }
            if (pp.getSecurityRef() != null)
            {
                SecurityReference ref2 = new BaseSecurityReference();
                ref2.setParent(pp.getSecurityRef());
                cp.setSecurityRef(ref2);
            }           
            pe.addParameter(cp);
        }
       
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

                {
                    pp.setImage(meta.getImage());
                    pp.setDescription(meta.getDescription());
                    pp.setTitle(meta.getTitle());
                }
                SecurityReference ref = cp.getSecurityRef();
                if (ref != null)
                {
                    pp.setSecurityRef(ref.getParent());
                }
                pp.save(conn);
            }
           
            // media types
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

            System.out.println("++++++++++++++++++++++++++++++++++++++++++++++++++++");
           
            assertTrue(rootset.getName().equals("theRootSet"));
            assertTrue(rootset.getId().equals("01"));
           
            SecurityReference securityRef = rootset.getSecurityRef();
            assertNotNull("got SecurityRef", securityRef);
            assertEquals( "Name of parent", "all_users", securityRef.getParent());
               
        }
        else
        {
            String errmsg = "PSML Mapping not found or not a file or unreadable.";
View Full Code Here

Examples of org.apache.jetspeed.om.SecurityReference

     * @param owner of the entry, i.e. the username
     * @return boolean true if the user has sufficient privilege.
     */
    public boolean checkPermission(JetspeedUser user, Portlet portlet, String action, String owner)
    {
        SecurityReference securityRef = portlet.getPortletConfig().getSecurityRef();
        if (securityRef != null)
        {
            return checkPermission( user, securityRef, action, owner);
        }

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.