4 ms·
Wouldn't union just work? authenticate() : role1 | role2
by machiaweliczny 6y ago
Wouldn't union just work?
authenticate() : role1 | role2
- ralls_ebfe 6y agoThis, or a union of access rights in a case where roles may be defined in a database.
- viraptor 6y agoThat assumes you know all the roles ahead of time. In many systems they will consist of a large number of variant both in how they authenticate and in what they're allowed to do. It may even depend on environment ideas which cannot be represented in types. (like: user X can issue commands Y, Z in times when they're on call, where "on-call" is a custom operator's rule, not something known earlier)
- fetbaffe 6y agoBut you do know every permission in advance, thus static. How a user gets a permission can be dynamic.