Skip to content

File download does not return an error when user is missing the download right #121603 #206

@a-schild

Description

@a-schild

When addind attachments to events, we can get hold of the file entries via the FileRequest::forEvent($eventId)->get() method.

$eventFiles= FileRequest::forEvent($eventId)->get();

This returns the array with all files, but when i later on try to download the file via $ctFile->downloadToPath('mytempfile.txt) and the user has no rights to download file:
a) A file with that name is still created
b) Content is wrong (Access error message with HTML)
c) Api still returns OK for the download

Message in downloaded file:
Keine ausreichende Berechtigung. Das Recht 'churchservice:view' ist notwendig.

Attached is such an example of a download without enough rights
Flyer.pdf

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingreported to churchtoolsReported bug or issue to churchtools. Ticket number is referred in title.

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions