From e161e39597fe69c26edbf861f4655bbb6403155c Mon Sep 17 00:00:00 2001 From: Hemachandar Date: Thu, 13 Nov 2025 18:01:22 +0530 Subject: [PATCH 1/3] add project role --- src/Database/Helpers/Role.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Database/Helpers/Role.php b/src/Database/Helpers/Role.php index 1682cb547..239262c75 100644 --- a/src/Database/Helpers/Role.php +++ b/src/Database/Helpers/Role.php @@ -175,4 +175,9 @@ public static function member(string $identifier): self { return new self('member', $identifier); } + + public static function project(string $identifier, string $dimension = ''): self + { + return new self('project', $identifier, $dimension); + } } From ad744de0844a61bc232b24544ac49d4168251f91 Mon Sep 17 00:00:00 2001 From: Hemachandar Date: Thu, 13 Nov 2025 18:23:38 +0530 Subject: [PATCH 2/3] add constraints --- src/Database/Validator/Roles.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Database/Validator/Roles.php b/src/Database/Validator/Roles.php index 0306118e7..127805cf3 100644 --- a/src/Database/Validator/Roles.php +++ b/src/Database/Validator/Roles.php @@ -15,6 +15,7 @@ class Roles extends Validator public const ROLE_TEAM = 'team'; public const ROLE_MEMBER = 'member'; public const ROLE_LABEL = 'label'; + public const ROLE_PROJECT = 'project'; public const ROLES = [ self::ROLE_ANY, @@ -24,6 +25,7 @@ class Roles extends Validator self::ROLE_TEAM, self::ROLE_MEMBER, self::ROLE_LABEL, + self::ROLE_PROJECT, ]; protected string $message = 'Roles Error'; @@ -108,6 +110,16 @@ class Roles extends Validator 'required' => false, ], ], + self::ROLE_PROJECT => [ + 'identifier' => [ + 'allowed' => true, + 'required' => true, + ], + 'dimension' => [ + 'allowed' => true, + 'required' => true, + ], + ] ]; // Dimensions From b00fcf1103164e0ace57e4e2fac07bcc9431b65e Mon Sep 17 00:00:00 2001 From: Hemachandar Date: Wed, 26 Nov 2025 11:05:31 +0530 Subject: [PATCH 3/3] remove phpstan ignore-error directive --- src/Database/Validator/Roles.php | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/Database/Validator/Roles.php b/src/Database/Validator/Roles.php index 127805cf3..d55723cda 100644 --- a/src/Database/Validator/Roles.php +++ b/src/Database/Validator/Roles.php @@ -298,8 +298,6 @@ protected function isValidRole( } // Required and has no dimension - // PHPStan complains because there are currently no dimensions that are required, but there might be in future - // @phpstan-ignore-next-line if ($allowed && $required && empty($dimension)) { $this->message = 'Role "' . $role . '"' . ' must have a dimension value.'; return false;