Bug 35870 - Adding an edit_authorities subpermission for editauthorities
Summary: Adding an edit_authorities subpermission for editauthorities
Status: Needs Signoff
Alias: None
Product: Koha
Classification: Unclassified
Component: Staff interface (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low enhancement
Assignee: Wainui Witika-Park
QA Contact: Testopia
URL:
Keywords:
: 31197 (view as bug list)
Depends on:
Blocks: 35871
  Show dependency treegraph
 
Reported: 2024-01-23 02:26 UTC by Wainui Witika-Park
Modified: 2025-03-04 03:05 UTC (History)
6 users (show)

See Also:
Change sponsored?: Sponsored
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
This enhancement adds a new sub permission for authority records - edit_authorities. This will enable the adding of more granular permissions in future bugs, such as deleting and editing authority records. Sponsored by: Education Services Australia SCIS
Version(s) released in:
Circulation function:


Attachments
Bug 35870: Adding new subpermission edit_authorities (7.75 KB, patch)
2024-01-23 03:46 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 35870: Adding new subpermission edit_authorities (8.39 KB, patch)
2024-01-24 00:34 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 35870: Adding new subpermission edit_authorities (8.40 KB, patch)
2025-01-28 05:09 UTC, Wainui Witika-Park
Details | Diff | Splinter Review
Bug 35870: Adding new subpermission edit_authorities (8.25 KB, patch)
2025-02-03 20:35 UTC, Aleisha Amohia
Details | Diff | Splinter Review
Bug 35870: Add new subpermission edit_authorities (8.55 KB, patch)
2025-02-03 23:37 UTC, David Nind
Details | Diff | Splinter Review
Bug 35870: Add new subpermission edit_authorities (8.97 KB, patch)
2025-03-04 03:05 UTC, Aleisha Amohia
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Wainui Witika-Park 2024-01-23 02:26:26 UTC

    
Comment 1 Wainui Witika-Park 2024-01-23 03:46:35 UTC Comment hidden (obsolete)
Comment 2 Wainui Witika-Park 2024-01-24 00:34:36 UTC
Created attachment 161317 [details] [review]
Bug 35870: Adding new subpermission edit_authorities

Test plan:
- apply patch
- login to staff client with your personal user
- make a new test user
- set the new test user's permissions to catalogue so they can access the staff client
- logout and log back in to the staff client as the new test user
- go to Authorities
- notice how you cannot add a new authority
- logout and log back in to the staff client as your personal user
- edit the new test user - add permission editauthorities and subpermission edit_authorities
- logout and log back in to the staff client as the test user
- go to Authorities
- notice how you can now add a new authority
- try adding a new authority and make sure you can edit it

Sponsored-by: Education Services Australia SCIS
Comment 3 David Nind 2024-05-25 19:59:38 UTC
The patch no longer applies 8-(...

git bz apply 35870

Bug 35870 - Adding an edit_authorities subpermission for editauthorities

161317 - Bug 35870: Adding new subpermission edit_authorities

Apply? [(y)es, (n)o, (i)nteractive] y
Applying: Bug 35870: Adding new subpermission edit_authorities
Using index info to reconstruct a base tree...
M	authorities/authorities.pl
M	installer/data/mysql/mandatory/userpermissions.sql
M	koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc
M	koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
M	koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
M	koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt
Falling back to patching base and 3-way merge...
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc
CONFLICT (content): Merge conflict in koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc
Auto-merging installer/data/mysql/mandatory/userpermissions.sql
Auto-merging authorities/authorities.pl
error: Failed to merge in the changes.
Patch failed at 0001 Bug 35870: Adding new subpermission edit_authorities
Comment 4 Wainui Witika-Park 2025-01-28 05:09:08 UTC
Created attachment 177208 [details] [review]
Bug 35870: Adding new subpermission edit_authorities

Test plan:
- apply patch
- login to staff client with your personal user
- make a new test user
- set the new test user's permissions to catalogue so they can access the staff client
- logout and log back in to the staff client as the new test user
- go to Authorities
- notice how you cannot add a new authority
- logout and log back in to the staff client as your personal user
- edit the new test user - add permission editauthorities and subpermission edit_authorities
- logout and log back in to the staff client as the test user
- go to Authorities
- notice how you can now add a new authority
- try adding a new authority and make sure you can edit it

Sponsored-by: Education Services Australia SCIS
Comment 5 Wainui Witika-Park 2025-01-28 05:10:29 UTC
(In reply to David Nind from comment #3)
> The patch no longer applies 8-(...
> 
> git bz apply 35870
> 
> Bug 35870 - Adding an edit_authorities subpermission for editauthorities
> 
> 161317 - Bug 35870: Adding new subpermission edit_authorities
> 
> Apply? [(y)es, (n)o, (i)nteractive] y
> Applying: Bug 35870: Adding new subpermission edit_authorities
> Using index info to reconstruct a base tree...
> M	authorities/authorities.pl
> M	installer/data/mysql/mandatory/userpermissions.sql
> M	koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc
> M	koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
> M
> koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
> M	koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt
> Falling back to patching base and 3-way merge...
> Auto-merging
> koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist.tt
> Auto-merging
> koha-tmpl/intranet-tmpl/prog/en/modules/authorities/searchresultlist-auth.tt
> Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/permissions.inc
> Auto-merging koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc
> CONFLICT (content): Merge conflict in
> koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc
> Auto-merging installer/data/mysql/mandatory/userpermissions.sql
> Auto-merging authorities/authorities.pl
> error: Failed to merge in the changes.
> Patch failed at 0001 Bug 35870: Adding new subpermission edit_authorities

sorry I missed this, I have submitted a new patch
Comment 6 Owen Leonard 2025-01-28 15:30:45 UTC
I don't understand the purpose of this patch. We have the "Edit authorities" permission already. What is this adding?
Comment 7 Katrin Fischer 2025-01-28 17:11:03 UTC
(In reply to Owen Leonard from comment #6)
> I don't understand the purpose of this patch. We have the "Edit authorities"
> permission already. What is this adding?

IIRC viewing is also tied to editauthorities, which is why we had to give the permission in the past, although they are not supposed to be edited.

I wonder if a "remaining authority permissions" is required here as well, as this is the first sub-permission for this module (thinking of how circulate is set up for example)
Comment 8 Owen Leonard 2025-01-28 18:11:12 UTC
Users without "Edit authorities" permission have permission to view authorities without any additional permissions required.
Comment 9 Aleisha Amohia 2025-01-29 00:53:36 UTC
(In reply to Owen Leonard from comment #6)
> I don't understand the purpose of this patch. We have the "Edit authorities"
> permission already. What is this adding?

See blocked Bug 35871 - it was to allow for other granular submissions like deleting and editing authorities
Comment 10 Katrin Fischer 2025-01-29 08:06:51 UTC
(In reply to Owen Leonard from comment #8)
> Users without "Edit authorities" permission have permission to view
> authorities without any additional permissions required.

Sorry, should have re-tested.
Comment 11 David Nind 2025-02-03 20:25:38 UTC
The patch still applies, however the database update to add the new permission doesn't work.
Comment 12 Aleisha Amohia 2025-02-03 20:35:17 UTC
Created attachment 177488 [details] [review]
Bug 35870: Adding new subpermission edit_authorities

Test plan:
- apply patch
- login to staff client with your personal user
- make a new test user
- set the new test user's permissions to catalogue so they can access the staff client
- logout and log back in to the staff client as the new test user
- go to Authorities
- notice how you cannot add a new authority
- logout and log back in to the staff client as your personal user
- edit the new test user - add permission editauthorities and subpermission edit_authorities
- logout and log back in to the staff client as the test user
- go to Authorities
- notice how you can now add a new authority
- try adding a new authority and make sure you can edit it

Sponsored-by: Education Services Australia SCIS
Comment 13 David Nind 2025-02-03 23:37:42 UTC
Created attachment 177493 [details] [review]
Bug 35870: Add new subpermission edit_authorities

Add a new sub permission for authority records - this will
enbale the adding other granular permssions in future bugs,
such as deleting and editing authority records.

Test plan:
1. Apply the patch.
2. Update the database.
3. Login to the staff interface as a superlibrarian.
4. Add or edit an existing staff patron.
5. Set the patron's permissions to catalogue so they can access
   the staff interface.
6. Logout and log back in to the staff interface as the patron.
7. Go to Authorities.
8. Notice how you cannot add a new authority record.
9. Logout and log back in to the staff interface as a superlibrarian.
10. Edit the staff patron - add permission editauthorities and
    sub permission edit_authorities.
11. Logout and log back in to the staff interface as the staff
    patron.
12. Go to Authorities.
13. Notice how you can now add a new authority record.
14. Try adding a new authority record and make sure you can edit it.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: David Nind <david@davidnind.com>
Comment 14 David Nind 2025-02-03 23:41:22 UTC
(In reply to David Nind from comment #11)
> The patch still applies, however the database update to add the new
> permission doesn't work.

Thanks Aleisha!
Comment 15 David Nind 2025-02-03 23:41:48 UTC
PS I edited the commit message.
Comment 16 Angela Berrett 2025-02-28 18:03:19 UTC
Does this resolve the request in Bug 31197?
Comment 17 Aleisha Amohia 2025-03-04 02:55:41 UTC
*** Bug 31197 has been marked as a duplicate of this bug. ***
Comment 18 Aleisha Amohia 2025-03-04 03:05:19 UTC
Created attachment 178895 [details] [review]
Bug 35870: Add new subpermission edit_authorities

Add a new sub permission for authority records - this will
enbale the adding other granular permssions in future bugs,
such as deleting and editing authority records.

Test plan:
1. Apply the patch.
2. Update the database.
3. Login to the staff interface as a superlibrarian.
4. Add or edit an existing staff patron.
5. Set the patron's permissions to catalogue so they can access
   the staff interface.
6. Logout and log back in to the staff interface as the patron.
7. Go to Authorities.
8. Notice how you cannot add a new authority record.
9. Logout and log back in to the staff interface as a superlibrarian.
10. Edit the staff patron - add permission editauthorities and
    sub permission edit_authorities.
11. Logout and log back in to the staff interface as the staff
    patron.
12. Go to Authorities.
13. Notice how you can now add a new authority record.
14. Try adding a new authority record and make sure you can edit it.

Sponsored-by: Education Services Australia SCIS
Signed-off-by: David Nind <david@davidnind.com>