Package org.apache.turbine.om.security

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


     */
    public Role getRoleById(int id)
            throws DataBackendException,
                   UnknownEntityException
    {
        Role role = getAllRoles().getRoleById(id);
        if (role == null)
        {
            throw new UnknownEntityException(
                    "The specified role does not exist");
        }
        role.setPermissions(getPermissions(role));
        return role;
    }
View Full Code Here


        //
        // Wrap the returned Objects into TorqueRoles.
        //
        for (Iterator it = list.iterator(); it.hasNext(); )
        {
            Role r = getNewRole((Persistent) it.next());
            newList.add(r);
        }

        return newList;
    }
View Full Code Here

     *
     */

    public static Role getNewRole(Persistent p)
    {
        Role r = null;
        try
        {
            Class roleWrapperClass = TurbineSecurity.getRoleClass();

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

                PermissionSet groupPermissions = new PermissionSet();
                // foreach role in Set
                for (Iterator rolesIterator = groupRoles.iterator();
                     rolesIterator.hasNext();)
                {
                    Role role = (Role) rolesIterator.next();
                    // get permissions of the role
                    PermissionSet rolePermissions
                            = PermissionPeer.retrieveSet(role);
                    groupPermissions.add(rolePermissions);
                }
View Full Code Here

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

                PermissionSet groupPermissions = new PermissionSet();
                // foreach role in Set
                for (Iterator rolesIterator = groupRoles.iterator();
                     rolesIterator.hasNext();)
                {
                    Role role = (Role) rolesIterator.next();
                    // get permissions of the role
                    PermissionSet rolePermissions =
                        PermissionPeerManager.retrieveSet(role);
                    groupPermissions.add(rolePermissions);
                }
View Full Code Here

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

                // foreach role in Set
                Iterator rolesIterator = groupRoles.iterator();

                while (rolesIterator.hasNext())
                {
                    Role role = (Role) rolesIterator.next();
                    // get permissions of the role
                    PermissionSet rolePermissions = getPermissions(role);

                    groupPermissions.add(rolePermissions);
                }
View Full Code Here

                {
                    NamingEnumeration values = attr.getAll();

                    while (values.hasMore())
                    {
                        Role role = getNewRole(values.next().toString());

                        roles.add(role);
                    }
                }
                else
View Full Code Here

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

                if (attr != null && attr.get() != null)
                {
                    Role role = getNewRole(attr.get().toString());

                    roles.add(role);
                }
                else
                {
View Full Code Here

TOP

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

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.