in extensions/torque/src/java/org/apache/turbine/services/security/torque/TorqueSecurityService.java [239:287]
public synchronized void revoke(User user, Group group, Role role)
throws DataBackendException, UnknownEntityException
{
boolean userExists = false;
boolean groupExists = false;
boolean roleExists = false;
try
{
lockExclusive();
userExists = TurbineSecurity.accountExists(user);
groupExists = checkExists(group);
roleExists = checkExists(role);
if (userExists && groupExists && roleExists)
{
Criteria criteria = new Criteria();
criteria.add(TurbineUserGroupRolePeer.USER_ID,
((Persistent) user).getPrimaryKey());
criteria.add(TurbineUserGroupRolePeer.GROUP_ID,
((Persistent) group).getPrimaryKey());
criteria.add(TurbineUserGroupRolePeer.ROLE_ID,
((Persistent) role).getPrimaryKey());
TurbineUserGroupRolePeer.doDelete(criteria);
return;
}
}
catch (Exception e)
{
throw new DataBackendException("revoke(User,Role,Group) failed", e);
}
finally
{
unlockExclusive();
}
if (!userExists)
{
throw new UnknownEntityException("Unknown user '"
+ user.getName() + "'");
}
if (!groupExists)
{
throw new UnknownEntityException("Unknown group '"
+ group.getName() + "'");
}
if (!roleExists)
{
throw new UnknownEntityException("Unknown role '"
+ role.getName() + "'");
}
}