Search code examples
laravellaravel-4permissionscartalyst-sentry

Are Permissions in Sentry 2 (by Cartalyst) associated with corresponding routes?


I'm trying to integrate Sentry 2 (by Cartalyst) in Laravel 4. I have a small query regarding the "Group Permissions".

On the documentation of Sentry 2, the use of permissions is shown as follows

"permissions" : {
        "user.create" : 1,
        "user.delete" : 1,
        "user.view"   : 1,
        "user.update" : 1
    }

My question is, are these permissions just some arbitrary names that we can use during development for decision making in access, or do these permissions actually relate to the corresponding route?

i.e. Is the permission "user.create" somehow associated to the route "users/create"?


Solution

  • The permissions you create for your groups and/or users in Sentry have nothing to do with the application routes. You can create and name the permissions as you wish.

    You can of course assign route filters to your routes, which in turn checks the required permission. Docs: http://laravel.com/docs/routing#route-filters

    Otherwise, when you for example want to create a user, you can just check if the current logged in user has the required permission before actually doing something.