public synchronized void revoke()

in torque/src/java/org/apache/fulcrum/security/torque/turbine/TorqueTurbineModelManagerImpl.java [125:164]


	public synchronized void revoke(Role role, Permission permission)
        throws DataBackendException, UnknownEntityException
    {
        boolean roleExists = getRoleManager().checkExists(role);
        boolean permissionExists = getPermissionManager().checkExists(permission);

        if (roleExists && permissionExists)
        {
        	if (role instanceof TurbineRole ) {
        		 ((TurbineRole)role).removePermission(permission);
            }
            if (permission instanceof TurbinePermission) {
            	 ((TurbinePermission)permission).removeRole(role);
            }
            
            try
            {
                Criteria criteria = new Criteria();
                criteria.where(TurbineRolePermissionPeer.ROLE_ID, role.getId());
                criteria.where(TurbineRolePermissionPeer.PERMISSION_ID, (Integer)permission.getId());
                TurbineRolePermissionPeer.doDelete(criteria);
            }
            catch (TorqueException e)
            {
                throw new DataBackendException("revoke('" + role.getName() + "', '" + permission.getName() + "') failed", e);
            }

            return;
        }

        if (!roleExists)
        {
            throw new UnknownEntityException("Unknown role '" + role.getName() + "'");
        }

        if (!permissionExists)
        {
            throw new UnknownEntityException("Unknown permission '" + permission.getName() + "'");
        }
    }