Skip to content

Roles

albert.resources.roles

Role

Bases: BaseResource

A named set of access permissions within a tenant.

A role bundles policies that determine what a holder is allowed to do. Roles are assigned to users (User) and referenced by entity ACLs. Roles are typically read from Albert rather than built by hand.

Show JSON schema:
{
  "$defs": {
    "AuditFields": {
      "description": "The audit fields for a resource",
      "properties": {
        "by": {
          "default": null,
          "title": "By",
          "type": "string"
        },
        "byName": {
          "anyOf": [
            {
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "Byname"
        },
        "at": {
          "anyOf": [
            {
              "format": "date-time",
              "type": "string"
            },
            {
              "type": "null"
            }
          ],
          "default": null,
          "title": "At"
        }
      },
      "title": "AuditFields",
      "type": "object"
    },
    "Status": {
      "description": "The status of a resource.\n\nAttributes\n----------\nACTIVE : str\n    The resource is fully operational and visible in normal operations.\nINACTIVE : str\n    The resource is hidden from normal operations and disabled from use.",
      "enum": [
        "active",
        "inactive"
      ],
      "title": "Status",
      "type": "string"
    }
  },
  "description": "A named set of access permissions within a tenant.\n\nA role bundles policies that determine what a holder is allowed to do. Roles\nare assigned to users ([`User`][albert.resources.users.User]) and referenced\nby entity ACLs. Roles are typically read from Albert rather than built by\nhand.",
  "properties": {
    "status": {
      "anyOf": [
        {
          "$ref": "#/$defs/Status"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The status of the resource, optional."
    },
    "Created": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit fields for the creation of the resource, optional."
    },
    "Updated": {
      "anyOf": [
        {
          "$ref": "#/$defs/AuditFields"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Audit fields for the update of the resource, optional."
    },
    "albertId": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The Albert ID of the role. Role IDs may contain ``#`` characters. Set once the role is retrieved from Albert.",
      "title": "Albertid"
    },
    "name": {
      "description": "The display name of the role.",
      "title": "Name",
      "type": "string"
    },
    "Policies": {
      "anyOf": [
        {
          "items": {},
          "type": "array"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "The policies (permission rules) associated with the role.",
      "title": "Policies"
    },
    "tenant": {
      "description": "The ID of the tenant the role belongs to.",
      "title": "Tenant",
      "type": "string"
    },
    "visibility": {
      "anyOf": [
        {
          "type": "boolean"
        },
        {
          "type": "null"
        }
      ],
      "default": null,
      "description": "Whether the role is visible in the platform's role listings.",
      "title": "Visibility"
    }
  },
  "required": [
    "name",
    "tenant"
  ],
  "title": "Role",
  "type": "object"
}

Fields:

id

id: str | None = None

The Albert ID of the role. Role IDs may contain # characters. Set once the role is retrieved from Albert.

name

name: str

The display name of the role.

policies

policies: list[Any] | None = None

The policies (permission rules) associated with the role.

tenant

tenant: str

The ID of the tenant the role belongs to.

visibility

visibility: bool | None = None

Whether the role is visible in the platform's role listings.