File tree Expand file tree Collapse file tree 1 file changed +6
-6
lines changed
src/Database/Validator/Authorization Expand file tree Collapse file tree 1 file changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -19,13 +19,13 @@ class Input
1919 /**
2020 * Create a new authorization input.
2121 *
22- * @param PermissionType $action The action being authorized (e.g., read, write)
22+ * @param PermissionType|string $action The action being authorized (e.g., read, write)
2323 * @param string[] $permissions List of permission strings to check against
2424 */
25- public function __construct (PermissionType $ action , array $ permissions )
25+ public function __construct (PermissionType | string $ action , array $ permissions )
2626 {
2727 $ this ->permissions = $ permissions ;
28- $ this ->action = $ action ->value ;
28+ $ this ->action = $ action instanceof PermissionType ? $ action ->value : $ action ;
2929 }
3030
3131 /**
@@ -44,12 +44,12 @@ public function setPermissions(array $permissions): self
4444 /**
4545 * Set the action being authorized.
4646 *
47- * @param PermissionType $action The action name
47+ * @param PermissionType|string $action The action name
4848 * @return self
4949 */
50- public function setAction (PermissionType $ action ): self
50+ public function setAction (PermissionType | string $ action ): self
5151 {
52- $ this ->action = $ action ->value ;
52+ $ this ->action = $ action instanceof PermissionType ? $ action ->value : $ action ;
5353
5454 return $ this ;
5555 }
You can’t perform that action at this time.
0 commit comments