Skip to content

Commit 49f023c

Browse files
author
Sandip Patel
committed
user module updated
1 parent 8ba39fd commit 49f023c

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/LaravelHelper.php

+13-1
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,16 @@ function has_module_permission($module, $permission)
2121

2222
return false;
2323
}
24-
}
24+
}
25+
26+
if (!function_exists('has_permission') )
27+
{
28+
function has_permission($permission)
29+
{
30+
if( !auth()->user()->can('allowed', $permission) )
31+
{
32+
abort(403, 'You are not allowed to access this area.');
33+
}
34+
}
35+
}
36+

0 commit comments

Comments
 (0)