app/Http/Controllers/Controller.php 1 location
|
@@ 119-132 (lines=14) @@
|
116 |
|
* |
117 |
|
* @return array |
118 |
|
*/ |
119 |
|
protected function getUser() |
120 |
|
{ |
121 |
|
$user = $this->userModel->getById($this->request->getIntegerParam('user_id', $this->userSession->getId())); |
122 |
|
|
123 |
|
if (empty($user)) { |
124 |
|
throw new PageNotFoundException(); |
125 |
|
} |
126 |
|
|
127 |
|
if (!$this->userSession->isAdmin() && $this->userSession->getId() != $user['id']) { |
128 |
|
throw new AccessForbiddenException(); |
129 |
|
} |
130 |
|
|
131 |
|
return $user; |
132 |
|
} |
133 |
|
|
134 |
|
/** |
135 |
|
* Get the current subtask. |
app/Http/Controllers/Task/CommentController.php 1 location
|
@@ 175-188 (lines=14) @@
|
172 |
|
* |
173 |
|
* @return array |
174 |
|
*/ |
175 |
|
protected function getComment() |
176 |
|
{ |
177 |
|
$comment = $this->commentModel->getById($this->request->getIntegerParam('comment_id')); |
178 |
|
|
179 |
|
if (empty($comment)) { |
180 |
|
throw new PageNotFoundException(); |
181 |
|
} |
182 |
|
|
183 |
|
if (!$this->userSession->isAdmin() && $comment['user_id'] != $this->userSession->getId()) { |
184 |
|
throw new AccessForbiddenException(); |
185 |
|
} |
186 |
|
|
187 |
|
return $comment; |
188 |
|
} |
189 |
|
} |
190 |
|
|