Вход под пользователем: право users.impersonate, Auth::impersonate()/realUser()
This commit is contained in:
1 parent
8dddca6d1a
commit
b8af28c181
11 files changed
+495
-36
No files matched your search
@@ -10,6 +10,7 @@ declare(strict_types=1);
|
||||
* @var array<int, array{id: string, kind: string, ip: string, agent: string, created: string, last: string, current: bool}> $devices
|
||||
*/
|
||||
|
||||
use Rsgrinko\Proton\Access\Permission;
|
||||
use Rsgrinko\Proton\Auth\Password;
|
||||
use Rsgrinko\Proton\View\View;
|
||||
|
||||
@@ -98,6 +99,18 @@ $hint = $isNew ? 'пусто — придумаем сами' : 'пусто
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<?php if (View::can(Permission::USERS_IMPERSONATE) && $user->id() !== View::viewer()->id() && $user->isActive()) { ?>
|
||||
<div class="card">
|
||||
<h2>Вход под пользователем</h2>
|
||||
<p class="muted small">Панель и сайт откроются его правами — свои действия увидите в журнале за него.</p>
|
||||
|
||||
<form method="post" action="<?= View::e(View::route('admin.users.impersonate', ['id' => $user->id()])) ?>">
|
||||
<?= View::csrf() ?>
|
||||
<button type="submit">Войти как <?= View::e((string) $user->login) ?></button>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<div class="card">
|
||||
<h2>Удаление</h2>
|
||||
<p class="muted small">Пользователь исчезнет вместе со своими сеансами. Его записи останутся.</p>
|
||||
|
||||
Reference in new issue
Block a user