Merge branch 'main' into develop
commit
9e2c29660d
|
@ -114,7 +114,6 @@ class TagBehavior extends Behavior
|
|||
$property = $this->getConfig('tagsAssoc.propertyName');
|
||||
$options['accessibleFields'][$property] = true;
|
||||
$options['associated']['Tags']['accessibleFields']['id'] = true;
|
||||
|
||||
if (isset($data['tags'])) {
|
||||
if (!empty($data['tags'])) {
|
||||
$data[$property] = $this->normalizeTags($data['tags']);
|
||||
|
@ -131,7 +130,6 @@ class TagBehavior extends Behavior
|
|||
if (!$tag->isNew()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$existingTag = $this->getExistingTag($tag->name);
|
||||
if (!$existingTag) {
|
||||
continue;
|
||||
|
@ -176,15 +174,14 @@ class TagBehavior extends Behavior
|
|||
$result[] = array_merge($common, ['id' => $existingTag->id]);
|
||||
continue;
|
||||
}
|
||||
|
||||
$result[] = array_merge(
|
||||
$common,
|
||||
[
|
||||
'name' => $tagIdentifier,
|
||||
'colour' => '#924da6'
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
|
|
@ -97,8 +97,16 @@ class UsersController extends AppController
|
|||
public function edit($id = false)
|
||||
{
|
||||
$currentUser = $this->ACL->getUser();
|
||||
if (empty($id) || (empty($currentUser['role']['perm_org_admin']) && empty($currentUser['role']['perm_admin']))) {
|
||||
if (empty($id)) {
|
||||
$id = $currentUser['id'];
|
||||
} else {
|
||||
if ((empty($currentUser['role']['perm_org_admin']) && empty($currentUser['role']['perm_admin']))) {
|
||||
if ($id !== $currentUser['id']) {
|
||||
throw new MethodNotAllowedException(__('You are not authorised to edit that user.'));
|
||||
} else {
|
||||
$id = $currentUser['id'];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$params = [
|
||||
|
|
Loading…
Reference in New Issue