mirror of
https://github.com/Neetpone/ponepaste.git
synced 2025-03-11 14:10:06 +01:00
fix(pastes): fix mods not being able to edit pastes
This commit is contained in:
parent
2cedd3eabe
commit
6ff64c0652
1 changed files with 5 additions and 1 deletions
|
@ -43,7 +43,11 @@ class AbilityHelper {
|
|||
return $user !== null
|
||||
&& ($user->id === $paste->user_id // Creators of pastes can delete their own pastes
|
||||
|| $user->role >= User::ROLE_ADMIN); // Admins can delete all pastes
|
||||
}
|
||||
},
|
||||
'blank' => function(User | null $user, Paste $paste) {
|
||||
return $user !== null
|
||||
&& $user->role >= User::ROLE_ADMIN; // Only admins can blank pastes
|
||||
},
|
||||
];
|
||||
$this->modelToActions['PonePaste\\Models\\User'] = [
|
||||
'view' => function(User | null $user, User $subject) {
|
||||
|
|
Loading…
Add table
Reference in a new issue