I would like to add a way to "copy" a user's permissions and "paste" them into another patron record. I can do this by reading the form state into localStorage and then parsing that to update the form state when editing another user's permissions.
+1
+1, this would be great.
+5 votes. In smaller libraries, a staff member has overlapping roles so we see quite a few customized permissions among the 6 member libraries in our Cooperative. When staff turnover occurs in those customized positions, this would be SO helpful.
Created attachment 153425 [details] [review] Bug 30623: Copy permissions from one user to another This patch adds controls to the patron "Set permissions" page allowing the user to copy a set of permissions from one patron to another. The patch also makes a minor correction to global staff interface CSS to correct the appearance of non-primary split buttons. To test, apply the patch and rebuild the staff interface CSS. You may want to clear your browser cache. - Locate a patron in the staff client and choose More -> Set permissions. You might want to start with a staff patron who has multiple permissions enabled. - You should see two new buttons in the toolbar immediately above the list of permissions: "Copy settings," a split button with a secondary option to choose "Forget copied settings"; and "Paste settings" which should be disabled by default. - Clicking the "Copy settings" button should trigger the copy icon to cycle/fade from the copy icon to the check-mark icon and back to the copy icon. I thought this interaction needed some visual feedback since it doesn't otherwise trigger visible action. - Clicking the "Copy settings" button should also enable the "Paste settings" button. - Locate another patron, preferable one with permissions visibly different from your first choice. - On their "Set permissions" page, click the "Paste settings" button. The list of permissions should expand all settings and all the checkboxes should now match your original choice. - At this stage you could find another patron and paste the same permissions again. - Click "Copy settings -> Forget copied settings." The "Paste settings" button should become disabled. - Using the browser console to check the contents of Local Storage should confirm that the "copiedPermissions" entry has been removed.
This is not as full-featured as Christopher Brannon's "Add clear and preset permission buttons, and a copy button to user permissions page" customization on the wiki, https://wiki.koha-community.org/wiki/JQuery_Library#Add_clear_and_preset_permission_buttons.2C_and_a_copy_button_to_user_permissions_page_.28v20.x.29, but I think it's a good first step for something that is generalized and simple.
Created attachment 153429 [details] [review] Bug 30623: Copy permissions from one user to another This patch adds controls to the patron "Set permissions" page allowing the user to copy a set of permissions from one patron to another. The patch also makes a minor correction to global staff interface CSS to correct the appearance of non-primary split buttons. To test, apply the patch and rebuild the staff interface CSS. You may want to clear your browser cache. - Locate a patron in the staff client and choose More -> Set permissions. You might want to start with a staff patron who has multiple permissions enabled. - You should see two new buttons in the toolbar immediately above the list of permissions: "Copy settings," a split button with a secondary option to choose "Forget copied settings"; and "Paste settings" which should be disabled by default. - Clicking the "Copy settings" button should trigger the copy icon to cycle/fade from the copy icon to the check-mark icon and back to the copy icon. I thought this interaction needed some visual feedback since it doesn't otherwise trigger visible action. - Clicking the "Copy settings" button should also enable the "Paste settings" button. - Locate another patron, preferable one with permissions visibly different from your first choice. - On their "Set permissions" page, click the "Paste settings" button. The list of permissions should expand all settings and all the checkboxes should now match your original choice. - At this stage you could find another patron and paste the same permissions again. - Click "Copy settings -> Forget copied settings." The "Paste settings" button should become disabled. - Using the browser console to check the contents of Local Storage should confirm that the "copiedPermissions" entry has been removed. Signed-off-by: Michal Denar <black23@gmail.com>
Moving this to In Discussion temporarily. Will mail QA about it. I am not very sure if we should do this via js and localStorage at the client side in terms of security.
Can we think of a way to define permissions profiles, and assign permission profiles instead?
I wouldn't think there was a security issue since I'm just saving the form state. The options in the form are available to anyone with permission to set permission. Folks have been wanting something like permission profiles for years, so I assume we'd have to find funding to make that happen.
(In reply to Owen Leonard from comment #9) > I wouldn't think there was a security issue since I'm just saving the form > state. The options in the form are available to anyone with permission to > set permission. And the form state is in localStorage and cannot be mangled ;)
(In reply to Marcel de Rooy from comment #10) > And the form state is in localStorage and cannot be mangled ;) I don't understand what you're trying to say here.
I'm not sure I'm a fan in terms of the UX but I don't see an issue from the security side. At a glance, it seems to only be copying the permission flags, so there is no data tying the permission flags to a particular user. The actual update is done server-side anyway, so it wouldn't be bypassing any authorization/validation steps.
(In reply to Tomás Cohen Arazi from comment #8) > Can we think of a way to define permissions profiles, and assign permission > profiles instead? 100% on it. That in fact is the solution. And with the possibility to import and export. - Pemission profile that can be assigned to a category of patron - Permission profile that can be assigne to a patron
Created attachment 155144 [details] [review] Bug 30623: Copy permissions from one user to another This patch adds controls to the patron "Set permissions" page allowing the user to copy a set of permissions from one patron to another. The patch also makes a minor correction to global staff interface CSS to correct the appearance of non-primary split buttons. To test, apply the patch and rebuild the staff interface CSS. You may want to clear your browser cache. - Locate a patron in the staff client and choose More -> Set permissions. You might want to start with a staff patron who has multiple permissions enabled. - You should see two new buttons in the toolbar immediately above the list of permissions: "Copy settings," a split button with a secondary option to choose "Forget copied settings"; and "Paste settings" which should be disabled by default. - Clicking the "Copy settings" button should trigger the copy icon to cycle/fade from the copy icon to the check-mark icon and back to the copy icon. I thought this interaction needed some visual feedback since it doesn't otherwise trigger visible action. - Clicking the "Copy settings" button should also enable the "Paste settings" button. - Locate another patron, preferable one with permissions visibly different from your first choice. - On their "Set permissions" page, click the "Paste settings" button. The list of permissions should expand all settings and all the checkboxes should now match your original choice. - At this stage you could find another patron and paste the same permissions again. - Click "Copy settings -> Forget copied settings." The "Paste settings" button should become disabled. - Using the browser console to check the contents of Local Storage should confirm that the "copiedPermissions" entry has been removed.
Created attachment 159552 [details] [review] Bug 30623: Copy permissions from one user to another This patch adds controls to the patron "Set permissions" page allowing the user to copy a set of permissions from one patron to another. The patch also makes a minor correction to global staff interface CSS to correct the appearance of non-primary split buttons. To test, apply the patch and rebuild the staff interface CSS. You may want to clear your browser cache. - Locate a patron in the staff client and choose More -> Set permissions. You might want to start with a staff patron who has multiple permissions enabled. - You should see two new buttons in the toolbar immediately above the list of permissions: "Copy settings," a split button with a secondary option to choose "Forget copied settings"; and "Paste settings" which should be disabled by default. - Clicking the "Copy settings" button should trigger the copy icon to cycle/fade from the copy icon to the check-mark icon and back to the copy icon. I thought this interaction needed some visual feedback since it doesn't otherwise trigger visible action. - Clicking the "Copy settings" button should also enable the "Paste settings" button. - Locate another patron, preferable one with permissions visibly different from your first choice. - On their "Set permissions" page, click the "Paste settings" button. The list of permissions should expand all settings and all the checkboxes should now match your original choice. - At this stage you could find another patron and paste the same permissions again. - Click "Copy settings -> Forget copied settings." The "Paste settings" button should become disabled. - Using the browser console to check the contents of Local Storage should confirm that the "copiedPermissions" entry has been removed.
(In reply to Marcel de Rooy from comment #7) > Moving this to In Discussion temporarily. Will mail QA about it. I'm curious whether there has been a QA team discussion about this?
(In reply to Owen Leonard from comment #16) > (In reply to Marcel de Rooy from comment #7) > > Moving this to In Discussion temporarily. Will mail QA about it. > > I'm curious whether there has been a QA team discussion about this? Owen, unfortunately I am not aware of any specific feedback that should have been noted here apart from the comment of Tomas.
I agree that permission profiles are the ultimate solution we should have, but this seems like it's available "now" and would be really helpful. I know my coworkers would love it as we do a lot of staff user setup in terms of "same permissions as user x". If we haven't been able to identify a security concern until now, I don't think this should be stuck in "In Discussion". The only comment I have is that I'd relabel "settings" to "permissions": Copy settings -> Copy permissions etc. Settings is a very general term, specific is always good for translations and such :)
(In reply to Katrin Fischer from comment #18) > I agree that permission profiles are the ultimate solution we should have, > but this seems like it's available "now" and would be really helpful. I know > my coworkers would love it as we do a lot of staff user setup in terms of > "same permissions as user x". +1
Sending this back into testing.
Created attachment 161700 [details] [review] Bug 30623: Copy permissions from one user to another This patch adds controls to the patron "Set permissions" page allowing the user to copy a set of permissions from one patron to another. The patch also makes a minor correction to global staff interface CSS to correct the appearance of non-primary split buttons. To test, apply the patch and rebuild the staff interface CSS. You may want to clear your browser cache. - Locate a patron in the staff client and choose More -> Set permissions. You might want to start with a staff patron who has multiple permissions enabled. - You should see two new buttons in the toolbar immediately above the list of permissions: "Copy settings," a split button with a secondary option to choose "Forget copied settings"; and "Paste settings" which should be disabled by default. - Clicking the "Copy settings" button should trigger the copy icon to cycle/fade from the copy icon to the check-mark icon and back to the copy icon. I thought this interaction needed some visual feedback since it doesn't otherwise trigger visible action. - Clicking the "Copy settings" button should also enable the "Paste settings" button. - Locate another patron, preferable one with permissions visibly different from your first choice. - On their "Set permissions" page, click the "Paste settings" button. The list of permissions should expand all settings and all the checkboxes should now match your original choice. - At this stage you could find another patron and paste the same permissions again. - Click "Copy settings -> Forget copied settings." The "Paste settings" button should become disabled. - Using the browser console to check the contents of Local Storage should confirm that the "copiedPermissions" entry has been removed. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Looking here
Created attachment 165108 [details] [review] Bug 30623: Copy permissions from one user to another This patch adds controls to the patron "Set permissions" page allowing the user to copy a set of permissions from one patron to another. The patch also makes a minor correction to global staff interface CSS to correct the appearance of non-primary split buttons. To test, apply the patch and rebuild the staff interface CSS. You may want to clear your browser cache. - Locate a patron in the staff client and choose More -> Set permissions. You might want to start with a staff patron who has multiple permissions enabled. - You should see two new buttons in the toolbar immediately above the list of permissions: "Copy settings," a split button with a secondary option to choose "Forget copied settings"; and "Paste settings" which should be disabled by default. - Clicking the "Copy settings" button should trigger the copy icon to cycle/fade from the copy icon to the check-mark icon and back to the copy icon. I thought this interaction needed some visual feedback since it doesn't otherwise trigger visible action. - Clicking the "Copy settings" button should also enable the "Paste settings" button. - Locate another patron, preferable one with permissions visibly different from your first choice. - On their "Set permissions" page, click the "Paste settings" button. The list of permissions should expand all settings and all the checkboxes should now match your original choice. - At this stage you could find another patron and paste the same permissions again. - Click "Copy settings -> Forget copied settings." The "Paste settings" button should become disabled. - Using the browser console to check the contents of Local Storage should confirm that the "copiedPermissions" entry has been removed. Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
> The only comment I have is that I'd relabel "settings" to "permissions": > Copy settings -> Copy permissions etc. Settings is a very general term, > specific is always good for translations and such :) I left 'settings' for now, but still feel permissions might be nicer. Any opinions? :) (using additional_work_needed to highlight the question :) )
Pushed for 24.05! Well done everyone, thank you!
Not backported to 23.11.x
Created attachment 167709 [details] [review] Bug 30623: (RM follow-up) Terminology: settings -> permissions We're copying permissions not settings here, so it makes sense to make that clear in the wording. Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
(In reply to Katrin Fischer from comment #24) > > The only comment I have is that I'd relabel "settings" to "permissions": > > Copy settings -> Copy permissions etc. Settings is a very general term, > > specific is always good for translations and such :) > > I left 'settings' for now, but still feel permissions might be nicer. Any > opinions? :) > > (using additional_work_needed to highlight the question :) ) I agree.. pushing follow-up.
I also agree with the wording change. Thank you!
Enhancement will not be included in the 24.05.x series
Oh wait, this was for the follow-up. That IS being pushed for 24.05.x. Sorry for the noise!