Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This is not possible, and by default roles are not global. Patch attached, but I didn't find a better option than a variable.
Comment | File | Size | Author |
---|---|---|---|
#15 | 1985800-15-og_global_roles_permissions.patch | 4.17 KB | japerry |
set_default_value_og_roles.patch | 654 bytes | SebCorbin | |
Comments
Comment #1
amitaibuI understand what you want -- but how would this deal with groups that have different settings?
Comment #2
SebCorbin CreditAttribution: SebCorbin commentedThis is a global setting, but how would we guess what the admin wants if we upgrade from a version that does not handles per-group permissions?
Comment #3
amitaibuYes, what I mean is that if the roles we request are global (i.e. via settings), then we probably can skip all the parts we try to set the permissions for those groups.
Comment #4
SebCorbin CreditAttribution: SebCorbin commentedI think these permissions (even global) are required for the good functionning of OG module.
I may not understand what you mean though, have ou any concrete task to fix this issue?
Comment #5
amitaibu> have ou any concrete task to fix this issue?
Yes, the question is how
OgUiSetRoles
should behave. Currently it sets permissions per group. How would your use case need it?Also, I'd be happy to get some docs about this variable, so it won't be completely hidden ;)
Comment #6
SebCorbin CreditAttribution: SebCorbin commentedAdding tag
Comment #7
SebCorbin CreditAttribution: SebCorbin commentedAs far as I can see,
OgUiSetRoles
set anonymous and authenticated permissions relative to group subscription based on the D6 property$node->og_selective
.If I set the variable
og_7000_access_field_default_value
to FALSE (global roles),OgUiSetRoles
runs but has no effect as roles are global.So I changed my patch to dynamically include
OgUiSetRoles
depending on the variable and I added documentation.When global roles are enabled, the admin will still need to check global permissions relative to subscription.
How does that sound?
Comment #8
amitaibuIf the variable is set to TRUE OgUiSetRoles should probably be skipped.
Comment #9
SebCorbin CreditAttribution: SebCorbin commentedA default value to TRUE means that there is no global roles and that OgUiSetRoles runs to set anonymous and authenticated permissions relative to group subscription.
Comment #10
amitaibuSorry, I meant FALSE.
Also it would be great if you could execute the migrate tests locally, as they are not picked up by the testbost.
Comment #12
SebCorbin CreditAttribution: SebCorbin commentedI added a little script that add global permissions on global roles based on Drupal's main permissions.
Comment #13
Gábor Hojtsy@sebcorbin: that patch sets a new default for the field, but it does not add the field... Is the field added already in the patched code? Should we remove the field in an update function on our own?Sorry wrong issue, meant for #2349587: Revoke ability to customize per group roles/permissions entirely.Comment #14
japerryHere is a re-roll with the latest version of og dev.
Comment #15
japerryThis needed some more work, the patch above was not mapping roles to the right rid's because of the og_role_save function, which sets rid as a primary key, and thus doesn't execute a drupal_write_record properly.
Its important to keep the rids the same, so I've taken the guts from og_role_save and applied it here.