Hi,
Id like to use PM in our site, but we need centralized Inbox.
Ive created my own PM admin module, which does this perfectly, the only issue I am having is the following line in the functon privatemsg_thread_load.
if (empty($thread['participants']) && privatemsg_user_access('read all private messages', $account)) {
Do you think you could create a way to allow other module to alter the permissions?
Something like:
if (empty($thread['participants']) && (privatemsg_user_access('read all private messages', $account) || privatemsg_user_access_alter($account))) {
Then in privatemsg_user_access_alter function we could allow other module to return a true or false value?
The reason behind this, with PM admins module, I allow other users to gain access to X user's inbox. Now, Id need to check if User X has access User Y's Inbox. If so, then return true, then the read_all variable would be set and everything would work flawlessly.
--
The other way I'm thinking of getting this to work, is cloning the privatemsg_thread_load function in my own module and altering the menu element but would I'd prefer adding the extra function in the module itself.
Comment | File | Size | Author |
---|---|---|---|
#3 | allmsg-module-invoke-1788226.patch | 1.61 KB | webadpro |
Comments
Comment #1
litwol CreditAttribution: litwol commentedI like the idea of being able to delegate access control to other modules.
What worries me is performance impact if we convert above simple check into a module_invoke* or equivalent.
My preference would be to maintain simplicity of current access check and extend it by adding another check for "extended access check enabled", and if so it will delegate access check to other modules via module_invoke*
By which i mean: Have both current implementation AND delegated permission check implementation in privatemsg, just make it possible to turn on and off via admin configuration.
Although, i haven't worked with privatemsg in a while... so take what i said with two grains of salt.
Lets see your patch :)
Comment #2
webadpro CreditAttribution: webadpro commentedAlright, I like the idea of having to enabling or disabling the extra permissions check-up but I'm not 100% sure if it is actually necessary.
I'll try to modify the code itself and see what I could come up with.
But any suggestion is greatly appreciated :)
Comment #3
webadpro CreditAttribution: webadpro commentedHow about something like this patch?
This patch would work great for me, and would allow me to do exactly what i need.
Comment #4
ptmkenny CreditAttribution: ptmkenny commentedComment #4.0
ptmkenny CreditAttribution: ptmkenny commentedExtra details.
Comment #5
oadaeh CreditAttribution: oadaeh as a volunteer commentedThis issue is being closed because it is against a branch for a version of Drupal that is no longer supported.
If you feel that this issue is still valid, feel free to re-open and update it (and any possible patch) to work with the 7.x-1.x branch (bug fixes only) or the 7.x-2.x branch.
Thank you.