0

I have four permissions in my permissions table in DB:

enter image description here

In my blade template I check for those permissions via directives like so:

    @permission('programs')
       dd('code where permission HAS NOT a dot in the name')
    @endpermission

    @permission('programs.store')
       dd('code where permission HAS a dot in the name')
    @endpermission

    @permission('programs.update')
       dd('code where permission HAS a dot in the name')
    @endpermission

An authorized user has a role with all the above permissions attached to it, however, code with permission programs does not work, while others do.

Why? How can it be fixed?

Virtual Device
  • 1,650
  • 3
  • 10
  • 26

1 Answers1

0

Oh....Entrust cached my previous settings for the user, so all you need is update cache each time you change user permission :

Cache::tags(config('entrust.permission_role_table'))->flush(); 
Virtual Device
  • 1,650
  • 3
  • 10
  • 26