Answer the question
In order to leave comments, you need to log in
What is the best storage option?
Good afternoon. Which option for storing user permissions (what can he do, what can't he do) is better to store?
1) permissions table and fields in it: group - user group, newsADD, newsEDIT, newsDELETE, where I set 1 - possible, 0 - impossible
2) permissions table and fields in it: group - user group, valuePerm - value what is possible, and what not: newsADD, newsEDIT, newsDELETE
In the first case, all fields are already defined, while in the second, permission values can be added.
Answer the question
In order to leave comments, you need to log in
Do you consider using third-party systems for setting rights and authentication?
If there are few audit objects (news, comments, etc.), then the 1st one is better: it
takes up less space, eight combinations of permissions for rights in one table entry
. audit), since in the first case you will have to add the extension of the first table. It will be done by adding fields (for example, commentAdd, commentEdit, commentDelete, etc.). And perhaps the records in the table will be very sparse in this case.
PS In general (if you don't use a third-party solution), it's better to structure it a bit (if there are other audit objects in addition to news):
- Audit object tables, Operation type, etc.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question