Sfoglia il codice sorgente

Add deleteMyProfile for profile rules

Admins can't delete themselves O_o
Visman 1 anno fa
parent
commit
cacaa46f0f
1 ha cambiato i file con 5 aggiunte e 0 eliminazioni
  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;;