Fix permission on delete token

This commit is contained in:
Laurent Destailleur
2024-08-31 19:26:46 +02:00
parent 827c3daa03
commit 815352e8f9
9 changed files with 20 additions and 9 deletions

View File

@@ -107,7 +107,8 @@ if (!getDolGlobalString($keyforparamsecret)) {
* Actions
*/
if ($action == 'delete') {
if ($action == 'delete' && (!empty($user->admin) || $user->id == GETPOSTINT('userid'))) {
$storage->userid = GETPOSTINT('userid');
$storage->clearToken('GitHub');
setEventMessages($langs->trans('TokenDeleted'), null, 'mesgs');