When a superlibrarian is logged in, C4::Auth::get_template_and_user pass the CAN_user_$flag to the template, but some are missing: suggestions, lists, cash_management So far they are not used in the template but it will avoid a developer to spend time on it if we fix it now.
Created attachment 114873 [details] [review] Bug 27345: Add missing global permissions for superlibrarian When a superlibrarian is logged in, C4::Auth::get_template_and_user pass the CAN_user_$flag to the template, but some are missing: suggestions, lists, cash_management So far they are not used in the template but it will avoid a developer to spend time on it if we fix it now. Test plan: Compare with installer/data/mysql/mandatory/userflags.sql Note that we don't need selfcheck
This could actually be a good opportunity to do some refactoring... If you go to https://bugs.koha-community.org/bugzilla3/page.cgi?id=splinter.html&bug=26791&attachment=113660 and click "Auth.pm", you'll see a function called "get_authz_from_flags". That could be further optimized by fetching the permissions from userflags (as you note) to dynamically make sure that the superlibrarian has all the right permissions. By the way, if we refactor it along the lines of what I've done on Bug 26791, we could add unit tests too. Originally I wanted to refactor C4::Auth::get_template_and_user, but I figured there was no hope doing it alone. But if you're interested in proving it, I'm happy to work with you.
I think maybe the refactor could go onto a separate bug? We will want to keep this small and easy for easy backport with little risk.
(In reply to Katrin Fischer from comment #3) > I think maybe the refactor could go onto a separate bug? We will want to > keep this small and easy for easy backport with little risk. I figured we'd have to test to the same degree in both cases so thought refactoring would be more efficient here but no worries if not.
I think we should keep this patch as simple as it is.
(In reply to Jonathan Druart from comment #5) > I think we should keep this patch as simple as it is. Sure thing
My test plan: 1. Go to http://localhost:8081/cgi-bin/koha/mainpage.pl 2. Note that you can see all the modules and options that you can usually see
Created attachment 114901 [details] [review] Bug 27345: Add missing global permissions for superlibrarian When a superlibrarian is logged in, C4::Auth::get_template_and_user pass the CAN_user_$flag to the template, but some are missing: suggestions, lists, cash_management So far they are not used in the template but it will avoid a developer to spend time on it if we fix it now. Test plan: Compare with installer/data/mysql/mandatory/userflags.sql Note that we don't need selfcheck Signed-off-by: David Cook <dcook@prosentient.com.au>
Created attachment 114962 [details] [review] Bug 27345: Add missing global permissions for superlibrarian When a superlibrarian is logged in, C4::Auth::get_template_and_user pass the CAN_user_$flag to the template, but some are missing: suggestions, lists, cash_management So far they are not used in the template but it will avoid a developer to spend time on it if we fix it now. Test plan: Compare with installer/data/mysql/mandatory/userflags.sql Note that we don't need selfcheck Signed-off-by: David Cook <dcook@prosentient.com.au> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Pushed to master for 21.05, thanks to everybody involved!
Pushed to 20.11.x for 20.11.02
Pushed to 20.05.x for 20.05.08
Not backported to oldoldstable (19.11.x). Feel free to ask if it's needed.