Roles

Overview

A role is a named binding between a set of users (the role membership) and a set of access rights (the role permissions).  According to Wikipedia,

Within an organization, roles are created for various job functions. The permissions to perform certain operations are assigned to specific roles. Members or staff (or other system users) are assigned particular roles, and through those role assignments acquire the computer permissions to perform particular computer-system functions. Since users are not assigned permissions directly, but only acquire them through their role (or roles), management of individual user rights becomes a matter of simply assigning appropriate roles to the user's account; this simplifies common operations, such as adding a user, or changing a user's department.

In SciDB, roles are used:

  • to control access to namespaces and the arrays they contain, and
  • to control access to database administrative functions.

When a user connects to SciDB, she acquires all access rights from all roles of which she is a member.

Role Operators

This table summarizes the AFL operators that manipulate roles.

OperatorDescription
list('roles')List existing roles.
create_roleCreate a new role.
drop_roleRemove a role.
add_user_to_roleAdd a user account to one or more roles.  The user account becomes a member of those roles.
drop_user_from_roleRemove a user account from one or more roles.  The user account loses its membership in those roles.
show_roles_for_userShow a user account's role memberships.
/wiki/spaces/ESD169/pages/50856184Show a role's members.
set_role_permissionsAssociate a role with access rights to an entity (typically a namespace).
show_role_permissionsShow the access rights associated with the role.

The create_user operator creates a role with the same name as the created user account.  This allows access rights to be granted on a per-user basis.  The automatically created per-user role is automatically removed by drop_user.  The role has only a single member, the corresponding user account.

The Special admin and operator Roles

The role names admin and operator are special.  When an administrator creates these roles using create_role(), they are automatically associated with access rights to an unnamed entity that represents the SciDB database.  The output of show_role_permissions for an ordinary namespace access role, experimenter, and the two special roles illustrates this:

FL% show_role_permissions('experimenter');
{i} entity,name,permissions
{0} 'namespace','trials','clru'
AFL% show_role_permissions('operator');
{i} entity,name,permissions
{0} 'database','','o'
AFL% show_role_permissions('admin');
{i} entity,name,permissions
{0} 'database','','a'

The next sections describe the privileges associated with the operator and admin roles.

Operator Privileges

User accounts granted the operator role can perform the following administrative functions:

Admin Privileges

The database administrator account scidbadmin and all user accounts granted the admin role have all the operator privileges listed above, plus the following: