Closed yorkshire-pudding closed 1 year ago
@yorkshire-pudding Does this PR overwrite permissions for existing Paragraphs types, or just provide defaults for new Paragraphs types? If the former that may be problematic in the case that someone has configured their Paragraphs type differently than these defaults, and then the permissions get overwritten by a default setting. (I haven't tested yet but I'm wondering about the changes in the install file.)
@yorkshire-pudding Two thoughts I'd love to hear your perspective on:
1) I think we need to use something like $admin_role = config_get('system.core', 'user_admin_role');
rather than assuming administrator
as the role.
2) We're using the same logic structures and strings multiple times for the conditional messages, etc. Is there any way to simplify that in a reasonable way to reduce redundancy?
@yorkshire-pudding Two thoughts I'd love to hear your perspective on:
- I think we need to use something like
$admin_role = config_get('system.core', 'user_admin_role');
rather than assumingadministrator
as the role.- We're using the same logic structures and strings multiple times for the conditional messages, etc. Is there any way to simplify that in a reasonable way to reduce redundancy?
Thanks for these suggestions @laryn - I hadn't considered the first one but of course, people can choose which role gets the new admin permissions. Regarding the second, yes, that component does make sense to put into a shared function. Two points to note:
get_t()
so it will work with hook_install
paragraphs_bundle_permissions_url()
function as this is called without a message from the Operations menu on the Paragraphs Overview page.Thanks for your persistence and patience @yorkshire-pudding! Merged.
Fixes #143