plugins.label_schemas.permissions#

Authorization for the label-schema operators.

Built on ctx.user (an fiftyone.operators.executor.ExecutionContextUser). FiftyOne has no users: ctx.user is None and every check passes, so the schema lens is a visibility preference any App user may edit. FiftyOne Enterprise populates ctx.user with the viewer’s role and dataset_permission on every operator execution, and these checks gate the operators there; an ADMIN bypasses dataset-permission thresholds.

Reads are VIEW-gated: listing/getting docs feeds the Explore schema lens and the dataset’s default-schema visibility, which must work for every viewer of the dataset. Mutations are MANAGE-gated.

Copyright 2017-2026, Voxel51, Inc.

Data:

PERMISSION_RANK

Dataset permission levels, ordered.

Functions:

permission_rank(permission)

Rank for a dataset permission (string or enum), 0 when unknown.

is_admin(ctx)

has_min_dataset_permission(ctx,Β minimum)

True when the viewer's dataset permission is at least minimum (no ctx.user β†’ no permission system β†’ True; ADMIN β†’ True).

can_read(ctx)

can_manage(ctx)

plugins.label_schemas.permissions.PERMISSION_RANK = {'EDIT': 3, 'MANAGE': 4, 'NO_ACCESS': 0, 'TAG': 2, 'VIEW': 1}#

Dataset permission levels, ordered. Mirrors fiftyone.internal.dataset_permissions.DatasetPermission.

plugins.label_schemas.permissions.permission_rank(permission) → int#

Rank for a dataset permission (string or enum), 0 when unknown.

plugins.label_schemas.permissions.is_admin(ctx) → bool#
plugins.label_schemas.permissions.has_min_dataset_permission(ctx, minimum: str) → bool#

True when the viewer’s dataset permission is at least minimum (no ctx.user β†’ no permission system β†’ True; ADMIN β†’ True).

plugins.label_schemas.permissions.can_read(ctx) → bool#
plugins.label_schemas.permissions.can_manage(ctx) → bool#