datacube.drivers.common_psql.grant_role#

datacube.drivers.common_psql.grant_role(conn, role, users)[source]#

Grant a UserRole to a user(s).

Attempts to revoke any existing memberships of more privileged roles from the user first.

Parameters:
  • conn (Connection) – An SQLAlchemy connection object

  • role (UserRoleBase) – The role to grant

  • users (Iterable[str]) – The usernames to grant the role to.

Return type:

bool

Returns:

True if the role was granted successfully.