hibernate/src/java/org/apache/fulcrum/security/hibernate/turbine/HibernateModelManagerImpl.java [187:236]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if (!roleExists)
        {
            throw new UnknownEntityException("Unknown role '" + role.getName() + "'");
        }
        if (!groupExists)
        {
            throw new UnknownEntityException("Unknown group '" + group.getName() + "'");
        }
        if (!userExists)
        {
            throw new UnknownEntityException("Unknown user '" + user.getName() + "'");
        }
    }

    /**
     * Revoke a Role in a Group from an User.
     * 
     * @param user
     *            the user.
     * @param group
     *            the group.
     * @param role
     *            the role.
     * @throws DataBackendException
     *             if there was an error accessing the data backend.
     * @throws UnknownEntityException
     *             if user account, group or role is not present.
     */
    public void revoke(User user, Group group, Role role) throws DataBackendException, UnknownEntityException
    {
        boolean roleExists = false;
        boolean userExists = false;
        boolean groupExists = false;
        try
        {
            roleExists = getRoleManager().checkExists(role);
            userExists = getUserManager().checkExists(user);
            groupExists = getGroupManager().checkExists(group);
            if (roleExists && groupExists && userExists)
            {
                boolean ugrFound = false;
                for (TurbineUserGroupRole ugr : ((TurbineUser) user).getUserGroupRoleSet())
                {
                    if (ugr.getUser().equals(user) && ugr.getGroup().equals(group) && ugr.getRole().equals(role))
                    {
                        ugrFound = true;

                        ((TurbineUser) user).removeUserGroupRole(ugr);
                        ((TurbineGroup) group).removeUserGroupRole(ugr);
                        ((TurbineRole) role).removeUserGroupRole(ugr);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



memory/src/java/org/apache/fulcrum/security/memory/turbine/MemoryTurbineModelManagerImpl.java [156:192]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        if (!roleExists)
        {
            throw new UnknownEntityException("Unknown role '" + role.getName() + "'");
        }
        if (!groupExists)
        {
            throw new UnknownEntityException("Unknown group '" + group.getName() + "'");
        }
        if (!userExists)
        {
            throw new UnknownEntityException("Unknown user '" + user.getName() + "'");
        }

    }

    public void revoke(User user, Group group, Role role) throws DataBackendException, UnknownEntityException
    {
        boolean roleExists = false;
        boolean userExists = false;
        boolean groupExists = false;
        try
        {
            roleExists = getRoleManager().checkExists(role);
            userExists = getUserManager().checkExists(user);
            groupExists = getGroupManager().checkExists(group);
            if (roleExists && groupExists && userExists)
            {
                boolean ugrFound = false;
                for (TurbineUserGroupRole ugr : ((TurbineUser) user).getUserGroupRoleSet())
                {
                    if (ugr.getUser().equals(user) && ugr.getGroup().equals(group) && ugr.getRole().equals(role))
                    {
                        ugrFound = true;

                        ((TurbineUser) user).removeUserGroupRole(ugr);
                        ((TurbineGroup) group).removeUserGroupRole(ugr);
                        ((TurbineRole) role).removeUserGroupRole(ugr);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



