com.scalar.db.sql.metadata.UserMetadata Maven / Gradle / Ivy
package com.scalar.db.sql.metadata;
import com.scalar.db.sql.Privilege;
import java.util.Set;
/** The metadata of a user. */
public interface UserMetadata {
/**
* Returns the name of the user.
*
* @return the name of the user
*/
String getName();
/**
* Returns {@code true} if the user is a superuser, {@code false} otherwise.
*
* @return {@code true} if the user is a superuser, {@code false} otherwise
*/
boolean isSuperuser();
/**
* Returns the user's privileges on the specified namespace.
*
* @param namespaceName the name of the target namespace
* @return the privileges of the user
*/
Set getPrivileges(String namespaceName);
/**
* Returns the user's privileges on the specified table.
*
* @param namespaceName the name of the namespace of the target table
* @param tableName the name of the target table
* @return the privileges of the user
*/
Set getPrivileges(String namespaceName, String tableName);
}