Browse Source

Add deleteMyProfile for profile rules

Admins can't delete themselves O_o
Visman 1 year ago
parent
commit
cacaa46f0f
1 changed files with 5 additions and 0 deletions
  1. 5 0
      app/Models/Rules/Profile.php

+ 5 - 0
app/Models/Rules/Profile.php

@@ -134,6 +134,11 @@ class Profile extends Rules
             && ! $this->curUser->isGuest;
     }
 
+    protected function getdeleteMyProfile(): bool
+    {
+        return $this->my && ! $this->user->isAdmin;
+    }
+
     protected function getviewIP(): bool
     {
         return $this->user->isAdmin;;