]> git.agnieray.net Git - galette.git/commitdiff
Fix authentication access level (not a user if not logger in!)
authorJohan Cwiklinski <johan@x-tnd.be>
Mon, 11 Mar 2024 21:04:50 +0000 (22:04 +0100)
committerJohan Cwiklinski <johan@x-tnd.be>
Mon, 11 Mar 2024 21:04:50 +0000 (22:04 +0100)
galette/lib/Galette/Core/Authentication.php

index c153bdf8f18d05b06eafa10626fbddf10b95352b..49d7976f279492f77135464f76cb7e54ada1fa3f 100644 (file)
@@ -38,6 +38,7 @@ use Galette\Entity\Group;
 
 abstract class Authentication
 {
+    public const ACCESS_PUBLIC = -1;
     public const ACCESS_USER = 0;
     public const ACCESS_MANAGER = 1;
     public const ACCESS_STAFF = 2;
@@ -356,8 +357,10 @@ abstract class Authentication
             return self::ACCESS_STAFF;
         } elseif ($this->isGroupManager()) {
             return self::ACCESS_MANAGER;
-        } else {
+        } elseif ($this->isLogged()) {
             return self::ACCESS_USER;
+        } else {
+            return self::ACCESS_PUBLIC;
         }
     }
 }