Merge pull request #14355 from fmarcet/10.0
Fix: User can see events that are not assigned to it
This commit is contained in:
commit
5482a3134a
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
/* Copyright (C) 2008-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@inodbox.com>
|
* Copyright (C) 2008-2017 Regis Houssin <regis.houssin@inodbox.com>
|
||||||
|
* Copyright (C) 2020 Ferran Marcet <fmarcet@2byte.es>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@ -556,6 +557,18 @@ function checkUserAccessToObject($user, $featuresarray, $objectid = 0, $tableand
|
|||||||
$sql.= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
|
$sql.= " WHERE dbt.".$dbt_select." IN (".$objectid.")";
|
||||||
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
$sql.= " AND dbt.entity IN (".getEntity($sharedelement, 1).")";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($feature == 'agenda')// Also check myactions rights
|
||||||
|
{
|
||||||
|
if ($objectid > 0 && empty($user->rights->agenda->allactions->read)) {
|
||||||
|
require_once DOL_DOCUMENT_ROOT . '/comm/action/class/actioncomm.class.php';
|
||||||
|
$action = new ActionComm($db);
|
||||||
|
$action->fetch($objectid);
|
||||||
|
if ($action->authorid != $user->id && $action->userownerid != $user->id && !(array_key_exists($user->id, $action->userassigned))) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
elseif (in_array($feature, $checkproject))
|
elseif (in_array($feature, $checkproject))
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user