diff --git a/includes/Helpers/AbilityHelper.php b/includes/Helpers/AbilityHelper.php index bf51d4c..83d2595 100644 --- a/includes/Helpers/AbilityHelper.php +++ b/includes/Helpers/AbilityHelper.php @@ -18,15 +18,15 @@ class AbilityHelper { public function can(string $action, mixed $subject) : bool { $is_destructive = in_array($action, self::DESTRUCTIVE_ACTIONS); - if (is_a($subject, 'Paste')) { - if (($subject->visible == Paste::VISIBILITY_PRIVATE) || $is_destructive) { + if (is_a($subject, 'PonePaste\\Models\\Paste')) { + if (((int) $subject->visible === Paste::VISIBILITY_PRIVATE) || $is_destructive) { return $this->user !== null && $subject->user_id === $this->user->id; } return true; } - if (is_a($subject, 'User')) { + if (is_a($subject, 'PonePaste\\Models\\User')) { return !$is_destructive || ($this->user !== null && $subject->id === $this->user->id); } diff --git a/theme/bulma/common.php b/theme/bulma/common.php index 89bc393..409e4f0 100644 --- a/theme/bulma/common.php +++ b/theme/bulma/common.php @@ -103,7 +103,7 @@ $flashes = getFlashes(); Archive - +