A
A
Abc Edc2015-09-03 22:37:10
Laravel
Abc Edc, 2015-09-03 22:37:10

Access content in laravel, best solution?

It is necessary that the admin has the ability to put down access to editing / creating / deleting data in certain content. For example, CRUD products or something else, that is, the rights to manage content for subadmins. The question is within laravel.
The solution comes to mind only to match the user's access to the current content in the middleware. That is, in the table to store user content and access to it. In order not to violate the standard route, it is precisely to pregmake the requested content and through which route it goes. The idea is definitely not the best, for sure there are some solutions out of the box in the chest (I didn’t find it) or some other non-cycling ones

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2015-09-04
@gleber1

Entrust - create roles and permissions, and assign them to the right users. And in the CRUD process, we simply ask:

if ( ! $user->can('posts.edit')) {
// Нельзя
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question