Vex · API
mergeScopePolicies
mergeScopePolicies merges the policies of a user with several roles (here member and usher) into one that permits whatever any of them permits. Where two policies grant the same phase, the rule set with fewer match conditions wins, because every match narrows the rows. A phase granted by only one policy keeps that policy’s rules.
{
shows: { read: [] },
bookings: {
read: [{ match: 'member_id', to: 'memberId' }],
insert: [{ set: 'member_id', to: 'memberId' }],
},
}{
shows: { read: [] },
members: { read: [] },
bookings: { read: [] },
}{
default: 'deny',
entities: {
shows: { read: [] },
bookings: {
read: [],
insert: [{ set: 'member_id', to: 'memberId' }],
},
members: { read: [] },
},
}Runs in this page on the installed package. The input and the expected output are defined by the example.