Answer the question
In order to leave comments, you need to log in
Why are roles assigned?
It is necessary to differentiate user access in the application. Made roles, guest
, admin
, user
. Accordingly, in the controller before the action, I check the role.
But all advanced systems use permissions in addition to roles. What for? Can two users with the same role have different permissions? What is the practical application, and why not just one role?
Answer the question
In order to leave comments, you need to log in
Imagine that we work in a publishing house. We write articles. The author brought the article and the editor began to work with it.
After several iterations, the editor can give the go-ahead, saying that the article is ready for publication. But in my imaginary edition, only the editor-in-chief can publish an article. The regular editor doesn't have permission to do this .
Other editors may also obtain permission to publish articles. For example, temporarily, when the editor-in-chief went on vacation.
So it turns out that everyone enters the same office, like editors. But some have more options than others.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question