You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Models/Group.php
+5-5Lines changed: 5 additions & 5 deletions
Original file line number
Diff line number
Diff line change
@@ -110,17 +110,17 @@ public function syncModulePermissions($id_module, $permessi)
110
110
}
111
111
}
112
112
113
-
// Se non ci sono viste predefinite, aggiungi il gruppo ad almeno una vista (la prima disponibile)
113
+
// Se non ci sono viste predefinite, aggiungi il gruppo a tutte le viste del modulo
114
114
if (empty($default_views)) {
115
-
$first_view = $database->fetchArray('SELECT `id` FROM `zz_views` WHERE `id_module`='.prepare($id_module).' ORDER BY `order` ASC LIMIT 1');
115
+
$all_views = $database->fetchArray('SELECT `id` FROM `zz_views` WHERE `id_module`='.prepare($id_module).' ORDER BY `order` ASC');
116
116
117
-
if (!empty($first_view)) {
118
-
$has_view_access = $database->fetchArray('SELECT COUNT(*) as cont FROM `zz_group_view` WHERE `id_gruppo` = '.prepare($this->id).' AND `id_vista` = '.prepare($first_view[0]['id']))['cont'];
117
+
foreach ($all_viewsas$view) {
118
+
$has_view_access = $database->fetchArray('SELECT COUNT(*) as cont FROM `zz_group_view` WHERE `id_gruppo` = '.prepare($this->id).' AND `id_vista` = '.prepare($view['id']))['cont'];
0 commit comments