dimanche 29 janvier 2017

Laravel 5.3 / Access to different properties or columns depending on role

Working on Project with a user table with authorization. Some of the users are admins, some are just members. Depending on the respective role, the logged in user can edit all users or just the own data.

Futhermore, depending on the role, the logged in user can change all or only a few of the properties, e.g. the property "role" itself.

The best solution seems to me, to create different models on the same table, maybe with different policies (single-table-inheritance so to say).

Is this the right approach? If not, what are the alternatives?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2jsLYVh
via IFTTT

Aucun commentaire:

Enregistrer un commentaire