mukmuk

Sounds interesting. I'll take a look at both possibilities and see how far i can get

mukmuk

I would like to change the behaviour of the modeladmins pagination. Is there a way to hook into it? The modeladmin should per default show all entities with this years date. The pagination would more or less just change the year to be shown. My dataobject has a date field of course :)

mukmuk

They're physically on the same server, so i could get them by the local path. Basically i could write a custom importer while using File::setFromLocalFile ? That would be the most stress-free way indeed

mukmuk

what is the preferred way for importing dataobjects by modeladmin's CSV importer?

upload all assets beforehand through /admin/assets/, then write down the File.ID as MyDataFileId in the csv?

mukmuk

Hey guys, I'm having a question on protected files uploaded by the backend. The directory has the permission "only viewable when logged in", the files inherit this. When putting the link into the frontend template, it works fine while logged in. But if the user isn't logged in, the same link will return "Not Found" (probable the default php-fpm message?). How can I intercept this and wrap it to some custom 403/404 page?

👍 (1)
wmk

there must be a hook for that... Does it claim "not found" or "Invalid Request" ?

mukmuk

just a white page stating "Not Found"

wmk

weird... you might check if it hits ProtectedFileController

mukmuk

i'm not even sure, if the requests hits the index.php 🤔

mukmuk

the file is in the hidden .protected folder, as it should be by the permissions. this is fine so far. if this very link (assets/myfolder/{10-alphanum-hash}/{filename}) will be opened from an unauthed person, he'll comes to the "Not Found" http 404 page

mukmuk

the problem i could think of or i try to solve, is, that a logged-in person might send the directlink to another person, who isn't logged in - or hasn't got any login at all. so i thought about adding a custom page to solve this

mukmuk

meh. seems that i got into this very issue: https://github.com/silverstripe/silverstripe-assets/issues/221

Show 1 attachment(s)
GitHub  
No support for deep-linking to protected assets · Issue #221 · silverstripe/silverstripe-assets

Assets that aren't publicly published can't be deep-linked. This is because some other request, such as the page linking to the asset, needs to "grant" access to the asset first, ...

Hide attachment content

Show less replies