Can someone speak to any potential performance impact/issues related to overlapping roles? That is, multiple roles with the same membership, but adding different privileges.
I am, for the moment, assuming no conflicting privileges, but that is also a thought in the back of my mind.
Motivation: I am working through ideas to make bootstrapping new databases more modular. Right off the bat, I am seeking a clean way to configure and bootstrap the auth portion of the app mostly independent of the rest of the rest of it. In doing so, I also hope to make it more straight forward to get new/different apps off the ground easier.
Using @databrecht ‘s Skeleton auth repo as an example of what I’m looking at… There is the logged in role:
{
name: 'membershiprole_loggedin',
membership: [
{
resource: Collection('accounts')
}
],
privileges: [
{
resource: Collection('dinos'),
actions: {
read: Query(
Lambda(['dinoReference'], Not(Equals(Select(['data', 'rarity'], Get(Var('dinoReference'))), 'legendary')))
)
}
},
{
resource: q.Function('request_reset'),
actions: { call: true }
}
]
}
What might the performance impact be if privileges are expanded by creating multiple roles, rather than updating an existing one?
// Auth module
{
name: 'membershiprole_loggedin',
membership: [
{
resource: Collection('accounts')
}
],
privileges: [
{
resource: q.Function('request_reset'),
actions: { call: true }
}
]
}
// Simple Dino module
{
name: 'membershiprole_loggedin_simpleDino',
membership: [
{
resource: Collection('accounts')
}
],
privileges: [
{
resource: Collection('dinos'),
actions: {
read: Query(
Lambda(['dinoReference'], Not(Equals(Select(['data', 'rarity'], Get(Var('dinoReference'))), 'legendary')))
)
}
},
]
}
// Advanced Dino module
{
name: 'membershiprole_loggedin_advancedDino',
membership: [
{
resource: Collection('accounts')
}
],
privileges: [
/* even more privileges ... */
]
}