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.
Hi,
Like your module. But I'd like to give some roles the permission to bypass the msnf setup.
Created a patch which allows a permission 'bypass msnf' to be set.
Cheers
Comment | File | Size | Author |
---|---|---|---|
#8 | img-1461948-8.png | 27.86 KB | stBorchert |
msnf.permission.patch | 857 bytes | Bartezz |
Comments
Comment #1
stBorchertThis is fixed in 7.x-1.0.
Other modules may alter the step information by using
hook_msnf_info_steps_alter(&$steps, $entity_type, $bundle)
.This way you can create a module which allows users with proper permissions to do not use steps at all.
Comment #2
Bartezz CreditAttribution: Bartezz commentedThat's a solution as well but a bit drastic having to create another module to create permissions for a module?
Why not use my patch?
Cheers
Comment #3
stBorchertI'm sorry to say this but I do not find it quite useful to add this permission. Using hook_msnf_info_steps_alter() is more generic so you can hide or alter the steps in any way you like. Including allowing some users to not use the steps at all.
Comment #5
thatjustin CreditAttribution: thatjustin commentedI've been searching for help as to how to implement hook_msnf_info_steps_alter(), I tried searching and IRC, to no avail. I'm not clear what I should be passing to the function. Any help would be appreciated.
Comment #6
thatjustin CreditAttribution: thatjustin commentedHere's what I have so far for my own custom "lpub" module, and a custom role named "Manager" (I'm not making a dedicated permission just yet):
Comment #7
thatjustin CreditAttribution: thatjustin commentedI'll post my solution to this issue, which is clearly not achieved via hook_msnf_info_steps_alter():
It's not the correct Drupal way to check for perms, and it requires hacking the msnf module itself, but it was the method that worked for me.
Comment #8
stBorchertExample to disable steps on node type "article":
Hiding steps for specific roles is as easy as the example above. Simply adjust the condition to your needs.
$steps_cached
is a structured array of this form:Comment #9
thatjustin CreditAttribution: thatjustin commentedThanks.