Package org.apache.jetspeed.om

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, Entry entry, String action, String owner)
    {
        SecurityReference securityRef = entry.getSecurityRef();
        if (securityRef == null)
        {
            return checkPermission( user, Registry.getEntry( Registry.PORTLET, entry.getParent()), action, owner);
        }
        return checkPermission( user, securityRef, action, owner);
View Full Code Here


     * @param owner of the entry, i.e. the username
     * @param action the jetspeed-action (view, edit, customize, delete...) for which permission is being checked.
     */
    private boolean checkPermission(JetspeedUser user,  RegistryEntry regEntry, String action, String owner)
    {
        SecurityReference securityRef = regEntry.getSecurityRef();
        if (securityRef == null)
            return true// No security defined on Registry entry
        return checkPermission( user, securityRef, action, owner);
    }
View Full Code Here

                        (SecurityEntry) Registry.getEntry(
                            Registry.SECURITY,
                            groupmergeSecurityref);
                    if (entry != null)
                    {
                        SecurityReference ref = new BaseSecurityReference();
                        ref.setParent(entry.getName());
                        portlets.setSecurityRef(ref);
                    }
                }

                String mediaType = null;
View Full Code Here

        try
        {
            String securityRefName =
                rundata.getParameters().getString("securityRef");
            SecurityReference securityRef = null;
            Profile profile =
                ((JetspeedRunData) rundata).getCustomizedProfile();
            Portlets portlets =
                profile.getDocument().getPortletsById(set.getID());

            if ((securityRefName != null)
                && (securityRefName.trim().length() > 0))
            {
                securityRef = new BaseSecurityReference();
                securityRef.setParent(securityRefName);
            }
            set.getPortletConfig().setSecurityRef(securityRef);
            portlets.setSecurityRef(securityRef);
        }
        catch (Exception e)
View Full Code Here

            {
                Portlets p = new PsmlPortlets();
                p.setMetaInfo(new PsmlMetaInfo());
                p.getMetaInfo().setTitle(title);
                p.setId(JetspeedIdGenerator.getNextPeid());
                SecurityReference defaultRef =
                    PortalToolkit.getDefaultSecurityRef(
                        ((JetspeedRunData) rundata).getCustomizedProfile());
                if (defaultRef != null)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug(
                            "CustomizeSetAction: setting default portlet set security to ["
                                + defaultRef.getParent()
                                + "]");
                    }
                    p.setSecurityRef(defaultRef);
                }
                portlets.addPortlets(p);
View Full Code Here

                    .getDocument()
                    .getPortletsById(set.getID());

            for (int i = 0; i < refNames.length; i++)
            {
                SecurityReference sref =
                    getSecurityReference(rundata, refNames[i]);
                if (sref != null)
                {
                    Reference ref = new PsmlReference();
                    ref.setPath(refNames[i]);
View Full Code Here

        portletEntry.setHidden(isHidden);
        //portletEntry.

        if (newSecurityParent != null && newSecurityParent.length() > 0)
        {
            SecurityReference securityRef = new BaseSecurityReference();
            securityRef.setParent(newSecurityParent);
            portletEntry.setSecurityRef(securityRef);
        }

        if (newSecurityRole != null && newSecurityRole.length() > 0)
        {
View Full Code Here

            {
                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

            {
                Portlets p = new PsmlPortlets();
                p.setMetaInfo(new PsmlMetaInfo());
                p.getMetaInfo().setTitle(title);
                p.setId(JetspeedIdGenerator.getNextPeid());
                SecurityReference defaultRef = PortalToolkit.getDefaultSecurityRef(
                    ((JetspeedRunData) rundata).getCustomizedProfile());
                if (defaultRef != null)
                {
                    if (logger.isDebugEnabled())
                    {
                        logger.debug("CustomizeSetAction: setting default portlet set security to [" + defaultRef.getParent() + "]");
                    }
                    p.setSecurityRef(defaultRef);
                }
                portlets.addPortlets(p);
            }
View Full Code Here

                                                           .getDocument()
                                                           .getPortletsById(set.getID());

            for (int i = 0; i < refNames.length; i++)
            {
                SecurityReference sref = getSecurityReference(rundata, refNames[i]);
                if (sref != null)
                {
                    Reference ref = new PsmlReference();
                    ref.setPath(refNames[i]);             
                    ref.setSecurityRef(sref);
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.om.SecurityReference

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.