The logical point of getting stuck. I am building a simple ACL and I'm just confused. I'm just trying to do it right.
Take an example of a simple model-based ACL.
Table of managing users tbl_user
id | userid | ------------- 1 | nabin | 2 | suman |
Another table for managing groups tbl_group
id | groupname | ----------------- 1 | admin | 2 | member | 3 | editor | 4 | moderator |
Another table to support groups and users. tbl_roles
id | userid | groupid ----------------------- 1 | 1 | 1 2 | 1 | 2 3 | 2 | 2 4 | 2 | 3 5 | 2 | 4
Now table for access control tbl_acl
id | groupid | appresourceid ---------------------------- 1 | 3 | 1
In this table, I will keep the ban list, because the ban list will definitely be shorter than the access list.
Now, according to the example of groupid:3 (editor) , resource 1 was denied (suppose this is an administration area).
But, if you take userid: 2(suman) , then it is both an editor and a moderator . According to the tbl_acl rule, editor should be rejected where moderator should be enabled.
Should it have access to the resource or should it be rejected? FIRST Allowed or FIRST Rejected . What should be a priority?
Some ways to search in this
- Although the user is denied as an editor, he as a moderator is allowed access to this area.
- Despite the fact that the moderator is allowed access to the resource, all editors are limited.
- Do not forget that the user is also a
member . Therefore, if we give priority to permission to refuse. The member will have access to the moderator. If, in addition, members are blocked.
<sub> Postscript I am well aware that this topic is controversial. Thus, the facts would be evaluated (not to mention) over opinions and assumptions. Sub>