Hey Andy,
I gave your first approach a go i.e. trying to alter
actor_can_view_entry.
That's simple enough, to make an exception there if a message is
direct and the api_user is the recipient. But there are side effects
in a couple of other places as you suggested. Namely, as far as I can
see, in api:entry_get where stream_get() falls over if the permissions
aren't there. So you have to make an exception there to not call
stream_get() if the message is direct and the api_user is the
recipient.
Further, in display:prep_entry, the entry's stream is appended to the
entry... you'll get a key error when it tries to find the entry's
(direct) stream in the list of streams passed (the list you have
permission to view, which obviously doesn't include others' direct
streams). So I've had to add another exception there where if the
message is direct and api user is the recipient, it'll get the Stream
directly and assign that to the entry.
I *think* they're the only places that need changing? At first blush
it seems to be working now, direct messages show up in the overviews
of the recipients and the senders, but nowhere else as far as I can
tell. I haven't set up views for direct message inboxes yet, and I
should probably create inbox entries for a recipient's private inbox
also.
Are the above workarounds sort of 'acceptable' from a security POV? Am
I opening up holes here, or is it OK as long as I only make exceptions
where an entry is 'direct' and the api user is the recipient?
Are there other places where I'd need to make changes too that aren't
as obvious? I haven't really done any major testing here, just
eyeballing it so to speak..
If I got this working with multiple recipients, and I tidied up some
things that are pretty ugly right now, I'd be happy to submit a patch
with the changes..i've never submitted a patch to a open source
project before, but i assume it's a fairly straight forward process..
Thanks again for your time!
On Apr 16, 9:28 pm, Andy Smith <
andys...@gmail.com> wrote: