From 07153982448820349c54158923d8c31853365d1b Mon Sep 17 00:00:00 2001 From: Shish Date: Wed, 15 Feb 2023 22:26:34 +0000 Subject: [PATCH] Use enum for permissions --- core/permissions.php | 3 +++ core/userclass.php | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/permissions.php b/core/permissions.php index 20ab0092..fe26d0a7 100644 --- a/core/permissions.php +++ b/core/permissions.php @@ -4,9 +4,12 @@ declare(strict_types=1); namespace Shimmie2; +use GQLA\Enum; + // action_object_attribute // action = create / view / edit / delete // object = image / user / tag / setting +#[Enum(name: "Permission")] abstract class Permissions { public const CHANGE_SETTING = "change_setting"; # modify web-level settings, eg the config table diff --git a/core/userclass.php b/core/userclass.php index ce78701e..7e72b333 100644 --- a/core/userclass.php +++ b/core/userclass.php @@ -39,7 +39,7 @@ class UserClass $_shm_user_classes[$name] = $this; } - #[Field(type: "[String!]!")] + #[Field(type: "[Permission!]!")] public function permissions(): array { global $_all_false;