fix: [internal] better error messages for attaching a tag failing

pull/5435/head
iglocska 2019-11-11 16:11:39 +01:00
parent 0f40cef0f1
commit 89a3d9b3fe
No known key found for this signature in database
GPG Key ID: BEA224F1FEF113AC
1 changed files with 2 additions and 2 deletions

View File

@ -955,10 +955,10 @@ class TagsController extends AppController
}
if (!$this->_isSiteAdmin()) {
if (!in_array($existingTag['Tag']['org_id'], array(0, $this->Auth->user('org_id')))) {
throw new MethodNotAllowedException('Invalid Tag.');
throw new MethodNotAllowedException('Invalid Tag. This tag can only be set by a fixed organisation.');
}
if (!in_array($existingTag['Tag']['user_id'], array(0, $this->Auth->user('id')))) {
throw new MethodNotAllowedException('Invalid Tag.');
throw new MethodNotAllowedException('Invalid Tag. This tag can only be set by a fixed user.');
}
}
$this->loadModel($objectType);