-
-
Notifications
You must be signed in to change notification settings - Fork 837
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[1.x] [suspend] fix: previously suspended admin users cannot remove t…
…heir avatar after suspension (#4071) * [1.x][suspend] fix: formally suspended admin users cannot remove their avatar after suspension * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot <[email protected]>
- Loading branch information
1 parent
5bd7e5d
commit 3a45ebc
Showing
2 changed files
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,12 +31,14 @@ public function setUp(): void | |
['id' => 3, 'username' => 'acme', 'email' => '[email protected]', 'is_email_confirmed' => 1, 'suspended_until' => Carbon::now()->addDay(), 'suspend_message' => 'You have been suspended.', 'suspend_reason' => 'Suspended for acme reasons.'], | ||
['id' => 4, 'username' => 'acme4', 'email' => '[email protected]', 'is_email_confirmed' => 1], | ||
['id' => 5, 'username' => 'acme5', 'email' => '[email protected]', 'is_email_confirmed' => 1, 'suspended_until' => Carbon::now()->subDay(), 'suspend_message' => 'You have been suspended.', 'suspend_reason' => 'Suspended for acme reasons.'], | ||
['id' => 6, 'username' => 'acme6', 'email' => '[email protected]', 'is_email_confirmed' => 1, 'suspended_until' => Carbon::now()->subWeek(), 'suspend_message' => 'You have been suspended.', 'suspend_reason' => 'Suspended for acme reasons.'], | ||
], | ||
'groups' => [ | ||
['id' => 5, 'name_singular' => 'can_edit_users', 'name_plural' => 'can_edit_users', 'is_hidden' => 0] | ||
], | ||
'group_user' => [ | ||
['user_id' => 2, 'group_id' => 5] | ||
['user_id' => 2, 'group_id' => 5], | ||
['user_id' => 6, 'group_id' => 1], | ||
], | ||
'group_permission' => [ | ||
['permission' => 'user.edit', 'group_id' => 5], | ||
|
@@ -73,6 +75,9 @@ public function allowedToRemoveAvatar(): array | |
[4, 4, 'Normal user can remove their own avatar'], | ||
[1, 3, 'Admin can remove avatar of suspended user'], | ||
[2, 3, 'Normal user with permission can remove avatar of suspended user'], | ||
[1, 6, 'Admin can remove avatar of expired suspended user'], | ||
[2, 6, 'Normal user with permission can remove avatar of expired suspended user'], | ||
[6, 6, 'Admin user can remove avatar if they have an expired suspension'], | ||
]; | ||
} | ||
|
||
|