CollectionPermissions defines the permissions for the collection (i.e., what the manager can and cannot do).

There are five types of permissions for a collection: ActionPermission, TimedUpdatePermission, TimedUpdateWithBadgeIdsPermission, BadgeIdsActionPermission, and CollectionApprovalPermission.

The permission type allows fine-grained access control for each action.

  • ActionPermission: defines when the manager can perform an action.
  • TimedUpdatePermission: defines when the manager can update a timeline-based field and what times of the timeline can be updated.
  • TimedUpdateWithBadgeIdsPermission: defines when the manager can update a timeline-based field for specific badges and what times of the timeline can be updated.
  • BadgeIdsActionPermission: defines when the manager can perform an action for specific badges
  • CollectionApprovalPermission: defines when the manager can update the transferability of the collection and what transfers can be updated vs. locked.

Note there are a few different times here which could get confusing:

  • timelineTimes: the times when a timeline-based field is a specific value
  • permanentlyPermitted/ForbiddenTimes - the times that a permission can be performed
  • transferTimes - the times that a transfer occurs
  • ownershipTimes - the times when a badge is owned by a user

The permitted/permanentlyForbiddenTimes are used to determine when a permission can be executed. Once a time is set to be permitted or forbidden, it is PERMANENT and cannot be changed. If a time is not set to be permitted or forbidden, it is considered NEUTRAL and can be updated but is ALLOWED by default.

IMPORTANT: We take first-match only for the permissions. This means that if you forbid time T in array index 0 and permit time T in index 1, we will only check the first permission (forbid time T) and not the second permission (permit time T).

from message badges.CollectionPermissions

Hierarchy

Constructors

Properties

canArchiveCollection: proto.badges.TimedUpdatePermission[] = []

Permissions related to archiving the collection.

from field: repeated badges.TimedUpdatePermission canArchiveCollection = 2;

canDeleteCollection: proto.badges.ActionPermission[] = []

Permissions related to deleting the collection.

from field: repeated badges.ActionPermission canDeleteCollection = 1;

canUpdateBadgeMetadata: proto.badges.TimedUpdateWithBadgeIdsPermission[] = []

Permissions related to updating badge metadata for specific badges.

from field: repeated badges.TimedUpdateWithBadgeIdsPermission canUpdateBadgeMetadata = 9;

canUpdateCollectionApprovals: proto.badges.CollectionApprovalPermission[] = []

Permissions related to updating collection approvals.

from field: repeated badges.CollectionApprovalPermission canUpdateCollectionApprovals = 10;

canUpdateCollectionMetadata: proto.badges.TimedUpdatePermission[] = []

Permissions related to updating the metadata of the collection.

from field: repeated badges.TimedUpdatePermission canUpdateCollectionMetadata = 7;

canUpdateCustomData: proto.badges.TimedUpdatePermission[] = []

Permissions related to updating custom data for the collection.

from field: repeated badges.TimedUpdatePermission canUpdateCustomData = 5;

canUpdateManager: proto.badges.TimedUpdatePermission[] = []

Permissions related to updating the collection's manager.

from field: repeated badges.TimedUpdatePermission canUpdateManager = 6;

canUpdateOffChainBalancesMetadata: proto.badges.TimedUpdatePermission[] = []

Permissions related to updating off-chain balances metadata.

from field: repeated badges.TimedUpdatePermission canUpdateOffChainBalancesMetadata = 3;

canUpdateStandards: proto.badges.TimedUpdatePermission[] = []

Permissions related to updating standards for the collection.

from field: repeated badges.TimedUpdatePermission canUpdateStandards = 4;

canUpdateValidBadgeIds: proto.badges.BadgeIdsActionPermission[] = []

Permissions related to creating more badges for the collection.

from field: repeated badges.BadgeIdsActionPermission canUpdateValidBadgeIds = 8;

fields: FieldList = ...
runtime: ProtoRuntime = proto3
typeName: "badges.CollectionPermissions" = "badges.CollectionPermissions"

Methods