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
administratorcan throughout web application adding schools, users , reviews etc.principalcan add/removestaff,reviewson school assignedadministrator. keep in mindprincipalcan assign existinguserstaffon school.staffcan addreviewsschool assigned eitheradministratororprincipaluserdefault-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