Updated validators
This commit is contained in:
parent
ec8be5eed1
commit
6c5f85e243
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue