use of org.apache.cassandra.auth.Permission in project eiger by wlloyd.
the class ClientState method hasColumnFamilySchemaAccess.
/**
* Confirms that the client thread has the given Permission for the ColumnFamily list of
* the current keyspace.
*/
public void hasColumnFamilySchemaAccess(Permission perm) throws InvalidRequestException {
validateLogin();
validateKeyspace();
// hardcode disallowing messing with system keyspace
if (keyspace.equalsIgnoreCase(Table.SYSTEM_TABLE) && perm == Permission.WRITE)
throw new InvalidRequestException("system keyspace is not user-modifiable");
resourceClear();
resource.add(keyspace);
Set<Permission> perms = DatabaseDescriptor.getAuthority().authorize(user, resource);
hasAccess(user, perms, perm, resource);
}
Aggregations