Package org.apache.turbine.om.security

Examples of org.apache.turbine.om.security.Permission


     * @return <code>true</code> if the user is assigned the Permission in any
     *         of the given Groups.
     */
    public boolean hasPermission( String permissionName, GroupSet groupset )
    {
        Permission permission;
        try
        {
            permission = TurbineSecurity.getPermission(permissionName);
        }
        catch(TurbineSecurityException e)
View Full Code Here


     */
    public Permission getPermissionById(int id)
            throws DataBackendException,
                   UnknownEntityException
    {
        Permission permission = getAllPermissions().getPermissionById(id);
        if (permission == null)
        {
            throw new UnknownEntityException(
                    "The specified permission does not exist");
        }
View Full Code Here

                {
                    throw new DataBackendException(
                            "Internal error - query returned "
                            + results.size() + " rows");
                }
                Permission newPermission = (Permission) results.get(0);
                // add the permission to system-wide cache
                getAllPermissions().add(newPermission);
                // return the object with correct id
                return newPermission;
            }
View Full Code Here

    public static final Vector getDifference(Vector some, Vector all)
    {
        Vector clone = (Vector) all.clone();
        for (Enumeration e = some.elements() ; e.hasMoreElements() ;)
        {
            Permission tmp = (Permission) e.nextElement();
            for (Enumeration f = clone.elements() ; f.hasMoreElements() ;)
            {
                Permission tmp2 = (Permission) f.nextElement();
                if (((Persistent) tmp).getPrimaryKey() ==
                    ((Persistent) tmp2).getPrimaryKey())
                {
                    clone.removeElement(tmp2);
                    break;
View Full Code Here

        //
        // Wrap the returned Objects into TorquePermissions.
        //
        for (Iterator it = list.iterator(); it.hasNext(); )
        {
            Permission p = getNewPermission((Persistent) it.next());
            newList.add(p);
        }

        return newList;
    }
View Full Code Here

     *
     */

    public static Permission getNewPermission(Persistent p)
    {
        Permission perm = null;
        try
        {
            Class permissionWrapperClass = TurbineSecurity.getPermissionClass();

            Class [] clazz = new Class [] { Persistent.class };
View Full Code Here

                {
                    throw new DataBackendException(
                        "Internal error - query returned "
                        + results.size() + " rows");
                }
                Permission newPermission = (Permission) results.get(0);
                // add the permission to system-wide cache
                getAllPermissions().add(newPermission);
                // return the object with correct id
                return newPermission;
            }
View Full Code Here

                Attributes attribs = sr.getAttributes();
                Attribute attr = attribs.get("turbinePermissionName");

                if (attr != null && attr.get() != null)
                {
                    Permission perm = getNewPermission(attr.get().toString());

                    permissions.add(perm);
                }
                else
                {
View Full Code Here

                    NamingEnumeration values = attr.getAll();

                    while (values.hasMore())
                    {
                        String permName = values.next().toString();
                        Permission perm = getNewPermission(permName);

                        permissions.put(perm.getName(), perm);
                    }
                }
            }
        }
        catch (NamingException ex)
View Full Code Here

    {
        PermissionSet permissions = getPermissions(role);
        Iterator permIterator = permissions.iterator();
        while (permIterator.hasNext())
        {
            Permission perm = (Permission) permIterator.next();
            revoke(role, perm);
        }
    }
View Full Code Here

TOP

Related Classes of org.apache.turbine.om.security.Permission

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.