Audit module: audit log and address bans
This commit is contained in:
1 parent
b75403e5ea
commit
d2ea1bacac
41 files changed
+2137
-5
No files matched your search
@@ -9,6 +9,7 @@ use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Hash;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
use IriksIT\Manager\Models\Group;
|
||||
use IriksIT\Manager\Support\AuditTrail;
|
||||
|
||||
/**
|
||||
* The accounts of the manager and the groups each is in.
|
||||
@@ -70,6 +71,7 @@ class AccountController
|
||||
$me = $request->user();
|
||||
$user = $this->find($account);
|
||||
abort_unless($me->managerOutranks($user), 403);
|
||||
app(AuditTrail::class)->about($user);
|
||||
|
||||
$request->validate([...$this->rules(), 'password' => ['nullable', 'string', 'min:12', 'max:200']]);
|
||||
$details = $this->details($request, $user);
|
||||
@@ -98,6 +100,7 @@ class AccountController
|
||||
$me = $request->user();
|
||||
$user = $this->find($account);
|
||||
abort_unless($me->managerOutranks($user), 403);
|
||||
app(AuditTrail::class)->about($user);
|
||||
|
||||
if ($user->is($me)) {
|
||||
return response()->json(['message' => 'You cannot delete your own account.'], 422);
|
||||
|
||||
Reference in new issue
Block a user