diff --git a/docs/guide/rest.md b/docs/guide/rest.md index 3bd341d626..6b434482b0 100644 --- a/docs/guide/rest.md +++ b/docs/guide/rest.md @@ -657,8 +657,7 @@ After a user is authenticated, you probably want to check if he has the permissi action for the requested resource. This process is called *authorization* which is covered in detail in the [Authorization chapter](authorization.md). -You may use the [[yii\web\AccessControl]] filter and/or the Role-Based Access Control (RBAC) component -to implementation authorization. +You may use the Role-Based Access Control (RBAC) component to implementation authorization. To simplify the authorization check, you may also override the [[yii\rest\Controller::checkAccess()]] method and then call this method in places where authorization is needed. By default, the built-in actions provided diff --git a/framework/base/Application.php b/framework/base/Application.php index 33efe2c657..f44edef68e 100644 --- a/framework/base/Application.php +++ b/framework/base/Application.php @@ -124,6 +124,10 @@ abstract class Application extends Module * 'name' => 'extension name', * 'version' => 'version number', * 'bootstrap' => 'BootstrapClassName', + * 'alias' => [ + * '@alias1' => 'to/path1', + * '@alias2' => 'to/path2', + * ], * ] * ~~~ */ diff --git a/framework/db/ActiveRecord.php b/framework/db/ActiveRecord.php index 74b22f89be..ad895e6599 100644 --- a/framework/db/ActiveRecord.php +++ b/framework/db/ActiveRecord.php @@ -8,6 +8,7 @@ namespace yii\db; +use Yii; use yii\base\InvalidConfigException; use yii\helpers\Inflector; use yii\helpers\StringHelper; @@ -376,6 +377,7 @@ class ActiveRecord extends BaseActiveRecord public function insert($runValidation = true, $attributes = null) { if ($runValidation && !$this->validate($attributes)) { + Yii::info('Model not inserted due to validation error.', __METHOD__); return false; } $db = static::getDb(); @@ -493,6 +495,7 @@ class ActiveRecord extends BaseActiveRecord public function update($runValidation = true, $attributes = null) { if ($runValidation && !$this->validate($attributes)) { + Yii::info('Model not updated due to validation error.', __METHOD__); return false; } $db = static::getDb(); diff --git a/framework/validators/ImageValidator.php b/framework/validators/ImageValidator.php index ebae6f1762..73ac14ff8e 100644 --- a/framework/validators/ImageValidator.php +++ b/framework/validators/ImageValidator.php @@ -132,7 +132,7 @@ class ImageValidator extends FileValidator $this->overHeight = Yii::t('yii', 'The image "{file}" is too large. The height cannot be larger than {limit, number} {limit, plural, one{pixel} other{pixels}}.'); } if ($this->wrongMimeType === null) { - $this->wrongMimeType = Yii::t('yii', 'Only files with these mimeTypes are allowed: {mimeTypes}.'); + $this->wrongMimeType = Yii::t('yii', 'Only files with these MIME types are allowed: {mimeTypes}.'); } if (!is_array($this->mimeTypes)) { $this->mimeTypes = preg_split('/[\s,]+/', strtolower($this->mimeTypes), -1, PREG_SPLIT_NO_EMPTY);