laravel - Cartalyst Sentinel Entity-Level Permissions -
so guys,
i've been using laravel 5
creating new web application manage reviews individual schools. , i've decided utilize cartalyst sentinel
package rbac.
so far i've setup 4 roles: administrator
, principal
, staff
, user
administrator
can throughout web application adding schools, users , reviews etc.principal
can add/removestaff
,reviews
on school assignedadministrator
. keep in mindprincipal
can assign existinguser
staff
on school.staff
can addreviews
school assigned eitheradministrator
orprincipal
user
default-role doesn't have privileges throughout system.
the flow i'm using administrator
creates users in system default have user
role assigned. , creates schools
, once school
saved, assigns user
users staff
or principal
.
problem have: roles in sentinel
work on application level explained web app, need entity
level permissions on individual users. suppose, user a
principal
school x
might staff
school y
.
how should handle in sentinel? introducing entity
/user
mapping table or should use permission
based access? if it's permission
based access, checks user id assignment given school programmed?
hope question not broad - i'll try narrow down further if needed. fact i've searched hours i've been able proper approach of checking whether action should performed or not - checking if user "is staff" or checking if user "can edit".
Comments
Post a Comment