Search in sources :

Example 1 with Permission

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);
}
Also used : Permission(org.apache.cassandra.auth.Permission) InvalidRequestException(org.apache.cassandra.thrift.InvalidRequestException)

Aggregations

Permission (org.apache.cassandra.auth.Permission)1 InvalidRequestException (org.apache.cassandra.thrift.InvalidRequestException)1