userurls = JetspeedLDAP.search(JetspeedLDAP.buildURL("ou=roles"),
"(&(uid="+ roleName+")(objectclass=jetspeedrole))", ATTRS, true);
if (userurls.size() == 0)
{
throw new PermissionException("Role '" + roleName + "' does not exist!");
}
else
{
role = new LDAPRole((LDAPURL) ((Vector)userurls.elementAt(0)).firstElement());
role.getRolePermissions().remove(permissionName);
role.update(false);
if (cachingEnable)
{
JetspeedSecurityCache.removePermission(roleName, permissionName);
}
}
}
catch(Exception e)
{
throw new PermissionException("Revoke permission '" + permissionName + "' to role '" + roleName + "' failed: ", e);
}
}