From 02dda8af9b915fe7864234a79b3355869bf6bd48 Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Wed, 22 Jan 2020 19:42:14 -0500 Subject: [PATCH] Add PUBLIC constant in Repository\Permission --- src/Repository/PermissionSet.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/Repository/PermissionSet.php b/src/Repository/PermissionSet.php index 7cbee4b836..36e6074c55 100644 --- a/src/Repository/PermissionSet.php +++ b/src/Repository/PermissionSet.php @@ -13,6 +13,8 @@ use Psr\Log\LoggerInterface; class PermissionSet extends BaseRepository { + const PUBLIC = 0; + protected static $table_name = 'permissionset'; protected static $model_class = Model\PermissionSet::class; @@ -47,7 +49,7 @@ class PermissionSet extends BaseRepository { if (isset($condition['id']) && !$condition['id']) { return $this->create([ - 'id' => 0, + 'id' => self::PUBLIC, 'uid' => $condition['uid'] ?? 0, 'allow_cid' => '', 'allow_gid' => '', @@ -109,7 +111,7 @@ class PermissionSet extends BaseRepository // Public permission if (!$allow_cid && !$allow_gid && !$deny_cid && !$deny_gid) { - return 0; + return self::PUBLIC; } $condition = [