note only post check 2
This commit is contained in:
@@ -169,6 +169,7 @@ class Note extends Record
|
||||
/**
|
||||
* @param NoteEntity $entity
|
||||
* @param stdClass $data
|
||||
* @throws Forbidden
|
||||
*/
|
||||
protected function beforeUpdateEntity(Entity $entity, $data)
|
||||
{
|
||||
@@ -178,6 +179,10 @@ class Note extends Record
|
||||
$this->handlePostText($entity);
|
||||
}
|
||||
|
||||
if (!$entity->isPost() && !$this->user->isAdmin()) {
|
||||
throw new ForbiddenSilent("Only 'Post' type allowed.");
|
||||
}
|
||||
|
||||
$entity->clear('targetType');
|
||||
$entity->clear('usersIds');
|
||||
$entity->clear('teamsIds');
|
||||
|
||||
Reference in New Issue
Block a user