Building User-Level Permissions
User Permission Structure
const userPermissions = {
canUpdateOutgoingApprovals: [
{
// fromListId: 'user-address', // Locked to user's address
toListId: 'All', // Can specify recipients
initiatedByListId: 'All',
transferTimes: FullTimeRanges,
tokenIds: FullTimeRanges,
ownershipTimes: FullTimeRanges,
approvalId: 'All',
permanentlyPermittedTimes: [],
permanentlyForbiddenTimes: FullTimeRanges, // Lock forever
},
],
canUpdateIncomingApprovals: [
{
fromListId: 'All', // Can specify senders
// toListId: 'user-address', // Locked to user's address
initiatedByListId: 'All',
transferTimes: FullTimeRanges,
tokenIds: FullTimeRanges,
ownershipTimes: FullTimeRanges,
approvalId: 'All',
permanentlyPermittedTimes: [],
permanentlyForbiddenTimes: FullTimeRanges, // Lock forever
},
],
canUpdateAutoApproveSelfInitiatedOutgoingTransfers: [
{
permanentlyPermittedTimes: [],
permanentlyForbiddenTimes: FullTimeRanges,
},
],
canUpdateAutoApproveSelfInitiatedIncomingTransfers: [
{
permanentlyPermittedTimes: [],
permanentlyForbiddenTimes: FullTimeRanges,
canUpdateAutoApproveAllIncomingTransfers: [
{
permanentlyPermittedTimes: [],
permanentlyForbiddenTimes: FullTimeRanges,
},
],
};Implementation
Related Examples
Last updated