Examples of RoleSet


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

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

     */
    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

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

    public void testAllRoles()
            throws Exception
    {
        SecurityService ss = TurbineSecurity.getService();

        RoleSet gs = ss.getAllRoles();

        assertEquals(2, gs.size());
    }
View Full Code Here

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

      throws Exception
    {
        SecurityService ss = TurbineSecurity.getService();

        GroupSet gs = ss.getAllGroups();
        RoleSet rs = ss.getAllRoles();
        PermissionSet ps = ss.getAllPermissions();

        List users = ss.getUserManager().retrieveList(new org.apache.torque.util.Criteria());

        assertEquals("Group DB Wrong!", gs.size(), 2);
        assertEquals("Role DB Wrong!", rs.size(), 2);
        assertEquals("Permission DB Wrong!", ps.size(), 3);
    }
View Full Code Here

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

     * @exception Exception a generic exception.
     */
    public static RoleSet retrieveSet(Criteria criteria) throws Exception
    {
        List results = RolePeer.doSelect(criteria);
        RoleSet rs = new RoleSet();
        for (int i = 0; i < results.size(); i++)
        {
            rs.add((Role) results.get(i));
        }
        return rs;
    }
View Full Code Here

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

     * @return an object representing the Role with specified name.
     */
    public Role getRole( String name )
        throws DataBackendException, UnknownEntityException
    {
        RoleSet roles = getAllRoles();
        Role role = roles.getRole(name);
        if(role != null)
        {
            role.setPermissions(getPermissions(role));
            return role;
        }
View Full Code Here

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

     * @return an object representing the Role with specified name.
     */
    public Role getRole( String name )
        throws DataBackendException, UnknownEntityException
    {
        RoleSet roles = getAllRoles();
        Role role = roles.getRole(name);
        if(role != null)
        {
            role.setPermissions(getPermissions(role));
            return role;
        }
View Full Code Here

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

      * @return a set of Roles that meet the specified Criteria.
      */
    public RoleSet getRoles(Criteria criteria) throws DataBackendException
    {
        Vector roles = new Vector(0);
        return new RoleSet(roles);
    }
View Full Code Here

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

            Iterator groupsIterator = getAllGroups().elements();
            while(groupsIterator.hasNext())
            {
                Group group = (Group)groupsIterator.next();
                // get roles of user in the group
                RoleSet groupRoles = RolePeer.retrieveSet( 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.elements();
                while(rolesIterator.hasNext())
                {
                    Role role = (Role)rolesIterator.next();
                    // get permissions of the role
                    PermissionSet rolePermissions = PermissionPeer.retrieveSet(role);
View Full Code Here

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

        }
        catch(Exception e)
        {
            throw new DataBackendException("getRoles(Criteria) failed", e);
        }
        return new RoleSet(roles);
    }
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.