Add permission check

pull/62/head
Varun Patil 2022-09-25 08:09:04 -07:00
parent 5296448311
commit 507a1c19a1
1 changed files with 4 additions and 2 deletions

View File

@ -260,7 +260,6 @@ class ApiController extends Controller {
/**
* @NoAdminRequired
* @NoCSRFRequired
*
* Change exif data for one file
* @param string fileid
@ -279,7 +278,10 @@ class ApiController extends Controller {
}
$file = $file[0];
// TODO: check permissions
// Check if user has permissions
if (!$file->isUpdateable()) {
return new JSONResponse([], Http::STATUS_FORBIDDEN);
}
// Get new date from body
$body = $this->request->getParams();