Use enum for permissions
This commit is contained in:
parent
86aa959097
commit
0715398244
2 changed files with 4 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -39,7 +39,7 @@ class UserClass
|
|||
$_shm_user_classes[$name] = $this;
|
||||
}
|
||||
|
||||
#[Field(type: "[String!]!")]
|
||||
#[Field(type: "[Permission!]!")]
|
||||
public function permissions(): array
|
||||
{
|
||||
global $_all_false;
|
||||
|
|
Reference in a new issue