How to define permission in controller,to access the function
For example, USER -> Joe
can use the function read create update delete
,but USER -> dog
can use the function only read.
In which table permission
can increase continuously, and define permission dynamic.
I know roles & permissions spatie but it makes the default table, which I want to use my table.
I have table permission
________________________________________________________
| id | APP | read | create | update | delete | group |
|------+------+------+--------+--------+--------+-------|
| 1 | aa | 1 | 1 | 1 | 1 | admin |
| 2 | bb | 1 | 0 | 0 | 0 | user |
| 3 | cc | 1 | 1 | 1 | 1 | admin |
|______|______|______|________|________|________|_______|
and i have table role
_______________________
| id | user | group |
|------+------+-------|
| 1 | joe | admin |
| 2 | dog | user |
| 3 | cat | admin |
|______|______|_______|