Skip to content

Commit c2c1f33

Browse files
committed
2 parents c0b441d + 534fd71 commit c2c1f33

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

README.md

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,14 +93,22 @@ echo $user_role;
9393
Check User Access or Permission
9494
```php
9595
checkPermission(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
102104
throw 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

106114
Check if a User is a Root User

0 commit comments

Comments
 (0)