File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -14,14 +14,9 @@ class AdminPolicy
1414 {
1515 use HandlesAuthorization;
1616
17- public function allowed ($ user , $ permission =null , $ plugin = null )
17+ public function allowed ($ user , $ permission =null )
1818 {
19- // if user has no access to module
2019 $ permission = $ permission ?: request ()->route ()->getName ();
21- if ( $ plugin && !config ('modules.enabled. ' .$ plugin ) ) {
22- return false ;
23- }
24-
2520 return $ user ->isSuperAdmin () ?: $ user ->checkPermission ($ permission );
2621 }
2722 }
Original file line number Diff line number Diff line change 1111 {
1212 function has_module_permission ($ module , $ permission )
1313 {
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 )) {
1619 return true ;
1720 }
1821
You can’t perform that action at this time.
0 commit comments