File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -93,14 +93,22 @@ echo $user_role;
9393Check User Access or Permission
9494``` php
9595checkPermission(string slug_of_permission) // returns true or false
96+ or
97+ checkPermissions(array slug_of_permissions) // returns true or false
9698```
97- Call the above function anywhere in your application. Example of usage:
99+ Call the above functions anywhere in your application. Example of usage:
98100``` php
99101@if(checkPermission('add_user')
100102// Do some stuff
101103@else
102104throw new \Exception("Access Forbidden", 1);
103105@endif
106+
107+ @if(checkPermissions(['add_user', 'view_user'])
108+ // Do some stuff
109+ @else
110+ throw new \Exception("Access Forbidden", 1);
111+ @endif
104112```
105113
106114Check if a User is a Root User
You can’t perform that action at this time.
0 commit comments