25 lines
623 B
PHP
25 lines
623 B
PHP
<?php
|
|
namespace Misuzu;
|
|
|
|
if(!$msz->authInfo->getPerms('user')->check(Perm::U_ROLES_MANAGE))
|
|
Template::throwError(403);
|
|
|
|
$roles = $msz->usersCtx->roles;
|
|
$pagination = new Pagination($roles->countRoles(), 10);
|
|
|
|
if(!$pagination->hasValidOffset())
|
|
Template::throwError(404);
|
|
|
|
$rolesAll = [];
|
|
$roleInfos = $roles->getRoles(pagination: $pagination);
|
|
|
|
foreach($roleInfos as $roleInfo)
|
|
$rolesAll[] = [
|
|
'info' => $roleInfo,
|
|
'members' => $roles->countRoleUsers($roleInfo),
|
|
];
|
|
|
|
Template::render('manage.users.roles', [
|
|
'manage_roles' => $rolesAll,
|
|
'manage_roles_pagination' => $pagination,
|
|
]);
|