File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
controllers/grid/settings/roles/form Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change 2020use APP \core \Request ;
2121use APP \facades \Repo ;
2222use APP \template \TemplateManager ;
23+ use Illuminate \Database \Eloquent \Builder as EloquentBuilder ;
2324use PKP \core \JSONMessage ;
2425use PKP \db \DAORegistry ;
2526use PKP \facades \Locale ;
@@ -116,7 +117,11 @@ public function initData()
116117 // Get a list of all settings-accessible user groups for the current user in
117118 // order to prevent them from locking themselves out by disabling the only one.
118119 $ mySettingsAccessUserGroupIds = UserGroup::withContextIds ([$ this ->getContextId ()])
119- ->withUserIds ([Application::get ()->getRequest ()->getUser ()->getId ()])
120+ ->whereHas (
121+ 'userUserGroups ' ,
122+ fn (EloquentBuilder $ q ) =>
123+ $ q ->withActive ()->withUserId (Application::get ()->getRequest ()->getUser ()->getId ())
124+ )
120125 ->get ()
121126 ->filter (fn ($ userGroup ) => $ userGroup ->permitSettings )
122127 ->map (fn ($ userGroup ) => $ userGroup ->id )
You can’t perform that action at this time.
0 commit comments