// we only care about schema modification.
if (!(perm.equals(Permission.ALTER) || perm.equals(Permission.DROP) || perm.equals(Permission.CREATE)))
return;
if (Schema.systemKeyspaceNames.contains(keyspace.toLowerCase()))
throw new UnauthorizedException(keyspace + " keyspace is not user-modifiable.");
// we want to allow altering AUTH_KS itself.
if (keyspace.equals(Auth.AUTH_KS) && !(resource.isKeyspaceLevel() && perm.equals(Permission.ALTER)))
throw new UnauthorizedException(String.format("Cannot %s %s", perm, resource));
}