File tree 2 files changed +6
-8
lines changed
2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,9 @@ class AdminPolicy
14
14
{
15
15
use HandlesAuthorization;
16
16
17
- public function allowed ($ user , $ permission =null , $ plugin = null )
17
+ public function allowed ($ user , $ permission =null )
18
18
{
19
- // if user has no access to module
20
19
$ permission = $ permission ?: request ()->route ()->getName ();
21
- if ( $ plugin && !config ('modules.enabled. ' .$ plugin ) ) {
22
- return false ;
23
- }
24
-
25
20
return $ user ->isSuperAdmin () ?: $ user ->checkPermission ($ permission );
26
21
}
27
22
}
Original file line number Diff line number Diff line change 11
11
{
12
12
function has_module_permission ($ module , $ permission )
13
13
{
14
- if (auth ()->user ()->can ('allowed ' , $ permission , $ module ))
15
- {
14
+ if ( $ module && !config ('modules.enabled. ' .$ module ) ) {
15
+ return false ;
16
+ }
17
+
18
+ if (auth ()->user ()->can ('allowed ' , $ permission )) {
16
19
return true ;
17
20
}
18
21
You can’t perform that action at this time.
0 commit comments