bedita/manager

Merge module accesses by role

Closed this issue · 0 comments

Actual behaviour

When two roles have different access type on the same module, the access on the module by a user that has both roles doesn't work as expected.
Example: the user "gustavo" belongs to two roles, "editor" and "guest" that have respectively "write access" and "read access" to the module "books". Gustavo has "readonly" access to the module "books".

Expected behaviour

When two roles have different access type on the same module, the access on the module by a user that has both roles should be "the powerest" access of the two roles.
Example: the user "gustavo" belongs to two roles, "editor" and "guest" that have respectively "write access" and "read access" to the module "books". Gustavo should have "write" access to the module "books".

Briefly: when a user belongs to more roles, module accesses should be merged, considering the higher power role on each module.

Note: accesses can be write, read, hidden. The "power" scale is exactly write > read > hidden.