Use enum for permissions

This commit is contained in:
Shish 2023-02-15 22:26:34 +00:00
parent 86aa959097
commit 0715398244
2 changed files with 4 additions and 1 deletions

View file

@ -4,9 +4,12 @@ declare(strict_types=1);
namespace Shimmie2; namespace Shimmie2;
use GQLA\Enum;
// action_object_attribute // action_object_attribute
// action = create / view / edit / delete // action = create / view / edit / delete
// object = image / user / tag / setting // object = image / user / tag / setting
#[Enum(name: "Permission")]
abstract class Permissions abstract class Permissions
{ {
public const CHANGE_SETTING = "change_setting"; # modify web-level settings, eg the config table public const CHANGE_SETTING = "change_setting"; # modify web-level settings, eg the config table

View file

@ -39,7 +39,7 @@ class UserClass
$_shm_user_classes[$name] = $this; $_shm_user_classes[$name] = $this;
} }
#[Field(type: "[String!]!")] #[Field(type: "[Permission!]!")]
public function permissions(): array public function permissions(): array
{ {
global $_all_false; global $_all_false;