Building Your Collection Permissions
Collection permissions are executable by the manager. They are used to control who can perform various management actions on your badge collection and when those actions are allowed.
const manager = collection.getCurrentManager();
Setting Your Permissions
You have a few options for setting your permissions.
No Manager
If you simply don't want a manager, you can set the manager to an empty string. Then, the permission values never matter.
const managerTimeline = [
{
manager: '',
timelineTimes: FullTimeRanges,
},
];
Complete Control - Soft Enabled
Each permission is enabled by default, unless you permanently disabled it. Thus, an empty array means that the permission is enabled for all times. However, it is soft enabled, meaning that the manager can disable it at any time. This configuration offers full control with ability to disable in the future.
const collectionPermissions = {
canDeleteCollection: [],
canArchiveCollection: [],
canUpdateOffChainBalancesMetadata: [],
canUpdateStandards: [],
canUpdateCustomData: [],
canUpdateManager: [],
canUpdateCollectionMetadata: [],
canUpdateBadgeMetadata: [],
canUpdateCollectionApprovals: [],
canUpdateValidBadgeIds: [],
};
Custom Permissions
Oftentimes, you want a little more control over your permissions though.
Each permission follows the same pattern:
For the times
permanentlyPermittedTimes
, the permission is always permitted for the given values.For the times
permanentlyForbiddenTimes
, the permission is always forbidden for the given values.If the item is not explicity in either, then the permission is enabled for the given values, but the status can change.
const CanArchiveCollection = {
permanentlyPermittedTimes: [],
permanentlyForbiddenTimes: FullTimeRanges,
timelineTimes: FullTimeRanges,
};
Each permission type follows the same pattern of two categories:
// Part 1. Enabled vs Disabled Times For The Execution Of The Permission
const permanentlyPermittedTimes = [];
const permanentlyForbiddenTimes = FullTimeRanges;
// Part 2. For what values (if any) does this apply? This is dependent on the permission type.
const {
timelineTimes,
badgeIds,
fromListId,
toListId,
initiatedByListId,
transferTimes,
ownershipTimes,
approvalId,
} = permission;
Main Permissions To Consider
Should the number of badge IDs in the collection be expandable? frozen upon genesis? -> Handle with
canUpdateValidBadgeIds
What about the transferability? -> Handle with
canUpdateCollectionApprovals
Should the transferability be frozen upon genesis?
Should we disallow updating transferability for only some badge IDs? some approvals? Mint? Post-Mint?
This could be critical for enforcing total circulating supply. For example, if you can create more approvals from the Mint address, then you can theoretically mint however many badges you want.
Examples
We refer you to the examples or relevant concepts for more detailed examples.
Related Concepts
Permission System
Timed Update Permission
Last updated