Skip to content
Discussion options

You must be logged in to vote

Hi @christmex ,

If what you want is to completely prevent the access of a CRUD page, the best place to put backpack_user()->can() is inside the CrudController. Since each Operation has its own setup method, that's the perfect place to do that:

public function setupCreateOperation() {
    if (!backpack_user()->can('something')) {
        abort(403, 'You are not allowed to do that.');
    }
}

Hope it helps.
Cheers!

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by christmex
Comment options

You must be logged in to vote
2 replies
@tabacitu
Comment options

@christmex
Comment options

Comment options

You must be logged in to vote
1 reply
@christmex
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants