1
0
Fork 0
mirror of synced 2024-06-02 19:04:49 +12:00

Updated validators

This commit is contained in:
Eldad Fux 2020-12-30 09:26:33 +02:00
parent ec8be5eed1
commit 6c5f85e243
2 changed files with 3 additions and 3 deletions

View file

@ -82,7 +82,7 @@ class Authorization extends Validator
}
}
$this->message = 'User is missing '.$this->action.' for "'.$permission.'" permission. Only this scopes "'.\json_encode(self::getRoles()).'" is given and only this are allowed "'.\json_encode($permissions[$this->action]).'".';
$this->message = 'Missing "'.$this->action.'" permission for role "'.$permission.'". Only this scopes "'.\json_encode(self::getRoles()).'" are given and only this are allowed "'.\json_encode($permissions[$this->action]).'".';
return false;
}

View file

@ -57,7 +57,7 @@ class Permissions extends Validator
}
foreach ($value as $action => $roles) {
if (!\in_array($action, ['read', 'write'])) {
if (!\in_array($action, ['read', 'write', 'execute'])) {
$this->message = 'Unknown action ("'.$action.'")';
return false;
@ -65,7 +65,7 @@ class Permissions extends Validator
foreach ($roles as $role) {
if (!\is_string($role)) {
$this->message = 'Permissions role must be a string';
$this->message = 'Permissions role must be of type string.';
return false;
}