Package org.apache.turbine.util.security

Examples of org.apache.turbine.util.security.RoleSet


            if(initialize)
            {
                permissionObject = TurbineSecurity.createPermission(permission);

                Role role = null;
                RoleSet roles = data.getACL().getRoles();
                if(roles.size() > 0) role = roles.getRolesArray()[0];

                if(role == null)
                {
                    /*
                     * The User within data has no roles yet, let us grant the permission
                     * to the first role available through TurbineSecurity.
                     */
                    roles = TurbineSecurity.getAllRoles();
                    if(roles.size() > 0) role = roles.getRolesArray()[0];
                }

                if(role != null)
                {
                    /*
 
View Full Code Here


     */
    public static RoleSet retrieveSet(Criteria criteria)
        throws Exception
    {
        List results = doSelect(criteria);
        RoleSet rs = new RoleSet();

        for (Iterator it = results.iterator(); it.hasNext(); )
        {
            rs.add((Role) it.next());
        }
        return rs;
    }
View Full Code Here

            for (Iterator groupsIterator = getAllGroups().iterator();
                 groupsIterator.hasNext();)
            {
                Group group = (Group) groupsIterator.next();
                // get roles of user in the group
                RoleSet groupRoles = RolePeerManager.retrieveSet(user, group);
                // put the Set into roles(group)
                roles.put(group, groupRoles);
                // collect all permissions in this group
                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 =
View Full Code Here

            }
            catch (TorqueException e)
            {
                throw new DataBackendException("getRoles(Criteria) failed", e);
            }
            return new RoleSet(roles);
        }
        else
        {
            throw new DataBackendException(
                    "getRoles(Object) failed with invalid criteria");
View Full Code Here

            while (groupsIterator.hasNext())
            {
                Group group = (Group) groupsIterator.next();

                // get roles of user in the group
                RoleSet groupRoles = getRoles(user, group);

                // put the Set into roles(group)
                roles.put(group, groupRoles);
                // collect all permissoins in this group
                PermissionSet groupPermissions = new PermissionSet();
                // foreach role in Set
                Iterator rolesIterator = groupRoles.iterator();

                while (rolesIterator.hasNext())
                {
                    Role role = (Role) rolesIterator.next();
                    // get permissions of the role
View Full Code Here

        {
            throw new DataBackendException(
                    "NamingException caught:", ex);
        }

        return new RoleSet(roles);
    }
View Full Code Here

        catch (NamingException ex)
        {
            throw new DataBackendException("NamingException caught", ex);
        }

        return new RoleSet(roles);
    }
View Full Code Here

     * @throws DataBackendException if there is an error with LDAP
     */
    public boolean checkExists(Role role)
            throws DataBackendException
    {
        RoleSet roleSet = getRoles(new Object());

        return roleSet.contains(role);
    }
View Full Code Here

    * Retrieves/assembles a RoleSet based on the Criteria passed in
    */
    public static RoleSet retrieveSet(Criteria criteria) throws Exception
    {
        Vector results = RolePeer.doSelect(criteria);
        RoleSet rs = new RoleSet();
        for (int i=0; i<results.size(); i++)
        {
            rs.add( (Role)results.elementAt(i) );
        }
        return rs;
    }
View Full Code Here

     *         backend.
     */
    public RoleSet getRoles(Object criteria) throws DataBackendException
    {

        return new RoleSet();
    }
View Full Code Here

TOP

Related Classes of org.apache.turbine.util.security.RoleSet

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.