diff --git a/Controller/BackendController.php b/Controller/BackendController.php index ff0bd72..a78467b 100644 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -311,6 +311,9 @@ final class BackendController extends Controller )); } + $groupPermission = GroupMapper::getPermissionForModule($id); + $view->setData('groupPermissions', $groupPermission); + return $view; } } diff --git a/Models/GroupMapper.php b/Models/GroupMapper.php index a4867d6..85cf55d 100644 --- a/Models/GroupMapper.php +++ b/Models/GroupMapper.php @@ -85,4 +85,23 @@ final class GroupMapper extends DataMapperAbstract 'src' => 'account_group_account', ], ]; + + /** + * Get groups which reference a certain module + * + * @param string $module Module + * + * @return array + * + * @since 1.0.0 + */ + public static function getPermissionForModule(string $module) : array + { + $query = self::getQuery(); + $query->innerJoin(GroupPermissionMapper::getTable()) + ->on(self::$table . '.group_id', '=', GroupPermissionMapper::getTable() . '.group_permission_group') + ->where(GroupPermissionMapper::getTable() . '.group_permission_module', '=', $module); + + return self::getAllByQuery($query); + } } diff --git a/Theme/Backend/modules-single.tpl.php b/Theme/Backend/modules-single.tpl.php index fbfa28c..a682b87 100644 --- a/Theme/Backend/modules-single.tpl.php +++ b/Theme/Backend/modules-single.tpl.php @@ -100,22 +100,25 @@ if ($nav !== null) {
| = $this->getHtml('ID', '0', '0'); ?> + | Type + | = $this->getHtml('Name'); ?> + |
| + | Group + | = $value->getName(); ?> + + + |
| = $this->getHtml('Empty', '0', '0'); ?> + + | ||