fix: Also safeguard generating tokens for group membership

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl 2023-01-12 08:52:27 +01:00
Родитель bc28249d38
Коммит bb89b7971e
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4C614C6ED2CDE6DF
1 изменённых файлов: 5 добавлений и 0 удалений

Просмотреть файл

@ -187,6 +187,11 @@ class TokenManager {
throw new NotPermittedException();
}
// Safeguard that users without required group permissions cannot create a token
if (!$this->permissionManager->isEnabledForUser($owneruid) && !$this->permissionManager->isEnabledForUser($editoruid)) {
throw new NotPermittedException();
}
// force read operation to trigger possible audit logging
\OC_Hook::emit(
Filesystem::CLASSNAME,