-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Добавлена проверка прав доступа на работу с разделом.
По умолчанию проверка прав отключена и доступ к разделам можно отключать посредством методов $model->disableDisplay(); $model->disableCreating(); $model->disableEditing(); $model->disableDeleting(); $model->disableRestoring(); Также можно включить проверку прав с помощью Policies Для этого необходимо включить ее $model->enableAccessCheck(); После чего создать для модели Policy класс для модели, которая используется в текущем разделе https://laravel.com/docs/5.2/authorization#policies И в класс Policy добавить методы public function display(User $user, Model $model); public function create(User $user, Model $model); public function edit(User $user, Model $model); public function restore(User $user, Model $model); public function delete(User $user, Model $model); После чего проверка прав будет дополнительно осуществляться на его основе issue #7
- Loading branch information
1 parent
9e6842b
commit 8e2d969
Showing
5 changed files
with
228 additions
and
24 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters