@@ 141-147 (lines=7) @@ | ||
138 | // check if action is submited |
|
139 | if ($this->request->request->get('closeRequest', false)) { |
|
140 | // if created by authorized user |
|
141 | if ((int)$record->user_id !== 0) { |
|
142 | $user = App::$User->identity(); |
|
143 | // button is pressed not by request creator |
|
144 | if ($user === null || $user->getId() !== (int)$record->user_id) { |
|
145 | throw new ForbiddenException(__('This feedback request was created by another user')); |
|
146 | } |
|
147 | } |
|
148 | ||
149 | // switch closed to 1 and make sql query |
|
150 | $record->closed = 1; |
@@ 50-52 (lines=3) @@ | ||
47 | $new = $record->id === null; |
|
48 | ||
49 | // reject edit published items and items from other authors |
|
50 | if (($new === false && (int)$record->author_id !== App::$User->identity()->getId()) || (int)$record->display === 1) { |
|
51 | throw new ForbiddenException(__('You have no permissions to edit this content')); |
|
52 | } |
|
53 | ||
54 | // initialize model |
|
55 | $model = new FormNarrowContentUpdate($record, $configs); |