mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-21 17:39:06 +02:00
Check for permissions before showing user infos or allow the user to change its own infos.
This commit is contained in:
parent
b9cd2fcc7f
commit
6ed2eeabae
5 changed files with 130 additions and 10 deletions
|
@ -55,10 +55,12 @@ class UserController extends AbstractController
|
|||
*/
|
||||
public function userInfo(?User $user, Packages $packages)
|
||||
{
|
||||
|
||||
//If no user id was passed, then we show info about the current user
|
||||
if($user == null) {
|
||||
$user = $this->getUser();
|
||||
} else {
|
||||
//Else we must check, if the current user is allowed to access $user
|
||||
$this->denyAccessUnlessGranted('read', $user);
|
||||
}
|
||||
|
||||
if($this->getParameter("use_gravatar")) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue