mirror of
https://github.com/lkddi/nexusphp.git
synced 2026-04-24 03:57:22 +08:00
fixed: create&edit tag no select mode error
This commit is contained in:
@@ -14,4 +14,12 @@ class CreateTag extends CreateRecord
|
|||||||
{
|
{
|
||||||
return $this->getResource()::getUrl('index');
|
return $this->getResource()::getUrl('index');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function mutateFormDataBeforeCreate(array $data): array
|
||||||
|
{
|
||||||
|
if ($data['mode'] === null) {
|
||||||
|
$data['mode'] = 0;
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,4 +22,12 @@ class EditTag extends EditRecord
|
|||||||
return $this->getResource()::getUrl('index');
|
return $this->getResource()::getUrl('index');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected function mutateFormDataBeforeSave(array $data): array
|
||||||
|
{
|
||||||
|
if ($data['mode'] === null) {
|
||||||
|
$data['mode'] = 0;
|
||||||
|
}
|
||||||
|
return $data;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -471,6 +471,9 @@ class UserRepository extends BaseRepository
|
|||||||
user_can('user-change-class', true);
|
user_can('user-change-class', true);
|
||||||
$operator = $this->getUser($operator);
|
$operator = $this->getUser($operator);
|
||||||
$targetUser = $this->getUser($targetUser);
|
$targetUser = $this->getUser($targetUser);
|
||||||
|
if ($operator && $operator->class <= $targetUser->class) {
|
||||||
|
throw new InsufficientPermissionException();
|
||||||
|
}
|
||||||
if ($targetUser->class == $newClass) {
|
if ($targetUser->class == $newClass) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user