Bug 20128 - Permission for advanced editor
Summary: Permission for advanced editor
Status: RESOLVED FIXED
Alias: None
Product: Koha
Classification: Unclassified
Component: Cataloging (show other bugs)
Version: master
Hardware: All All
: P5 - low enhancement (vote)
Assignee: Nick Clemens
QA Contact: Martin Renvoize
URL:
Keywords:
Depends on: 22031
Blocks: 22748
  Show dependency treegraph
 
Reported: 2018-02-02 10:32 UTC by Kyle M Hall
Modified: 2019-05-30 11:20 UTC (History)
8 users (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Who signed the patch off:
Text to go in the release notes:
Adds a new permission, under the "cataloguing" module, that controls whether the advanced (direct text editor based) cataloging editor is available.
Version(s) released in:
19.05.00


Attachments
Bug 20128: Add permission for advanced cataloging editor (6.57 KB, patch)
2018-12-20 13:44 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 20128: Add permission for advanced cataloging editor (6.63 KB, patch)
2019-03-06 17:22 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 20128: Add permission for advanced cataloging editor (6.68 KB, patch)
2019-03-06 19:08 UTC, Liz Rea
Details | Diff | Splinter Review
Bug 20128: Add permission for advanced cataloging editor (6.56 KB, patch)
2019-03-12 13:52 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 20128: Add permission for advanced cataloging editor (6.56 KB, patch)
2019-03-16 13:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 20128: Problem when checking individual perms where borrower has top level (1.49 KB, patch)
2019-03-16 13:45 UTC, Nick Clemens
Details | Diff | Splinter Review
Bug 20128: (QA Follow-up) Corrections to haspermission (1.69 KB, patch)
2019-03-21 10:20 UTC, Martin Renvoize
Details | Diff | Splinter Review
Bug 20128: Add permission for advanced cataloging editor (6.65 KB, patch)
2019-04-10 21:39 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20128: Problem when checking individual perms where borrower has top level (1.55 KB, patch)
2019-04-10 21:40 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20128: (QA follow-up) Corrections to haspermission (1.74 KB, patch)
2019-04-10 21:40 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20128: Add new permission for new installations (1.21 KB, patch)
2019-04-10 21:40 UTC, Katrin Fischer
Details | Diff | Splinter Review
Bug 20128: (QA follow-up) Rename flgAnonymized column for anonymized (11.24 KB, patch)
2019-04-17 14:28 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review
Bug 20128: Fix the API (1.29 KB, patch)
2019-04-17 14:28 UTC, Tomás Cohen Arazi
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Kyle M Hall 2018-02-02 10:32:45 UTC
Work to be done:
1) Create a new permission, under the "cataloguing" module, that controls whether the professional cataloging editor is available.
Comment 1 Nick Clemens 2018-12-20 13:44:58 UTC
Created attachment 83416 [details] [review]
Bug 20128: Add permission for advanced cataloging editor

To test:
1 - Have a borrower with edit_catalogue permission and one with
editcatalogue top level
2 - Confirm they can both access the advanced editor from the
'Cataloguing' home page or from the basic editor
3 - Apply patch
4 - Update database
5 - Confirm borrower with 'edit_catalogue' has 'advanced_editor'
permission
6 - Confirm borrowers can access advanced editor as above
7 - Remove 'advanced_editor' permission from borrower
8 - Ensure they cannot access the advanced editor
9 - Ensure links to 'Edit record' from search results go to basic editor
Comment 2 Nick Clemens 2019-03-06 17:22:02 UTC
Created attachment 86198 [details] [review]
Bug 20128: Add permission for advanced cataloging editor

To test:
1 - Have a borrower with edit_catalogue permission and one with
editcatalogue top level
2 - Confirm they can both access the advanced editor from the
'Cataloguing' home page or from the basic editor
3 - Apply patch
4 - Update database
5 - Confirm borrower with 'edit_catalogue' has 'advanced_editor'
permission
6 - Confirm borrowers can access advanced editor as above
7 - Remove 'advanced_editor' permission from borrower
8 - Ensure they cannot access the advanced editor
9 - Ensure links to 'Edit record' from search results go to basic editor
Comment 3 Liz Rea 2019-03-06 19:08:48 UTC
Created attachment 86208 [details] [review]
Bug 20128: Add permission for advanced cataloging editor

To test:
1 - Have a borrower with edit_catalogue permission and one with
editcatalogue top level
2 - Confirm they can both access the advanced editor from the
'Cataloguing' home page or from the basic editor
3 - Apply patch
4 - Update database
5 - Confirm borrower with 'edit_catalogue' has 'advanced_editor'
permission
6 - Confirm borrowers can access advanced editor as above
7 - Remove 'advanced_editor' permission from borrower
8 - Ensure they cannot access the advanced editor
9 - Ensure links to 'Edit record' from search results go to basic editor

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Comment 4 Martin Renvoize 2019-03-12 13:52:40 UTC
Created attachment 86543 [details] [review]
Bug 20128: Add permission for advanced cataloging editor

To test:
1 - Have a borrower with edit_catalogue permission and one with
editcatalogue top level
2 - Confirm they can both access the advanced editor from the
'Cataloguing' home page or from the basic editor
3 - Apply patch
4 - Update database
5 - Confirm borrower with 'edit_catalogue' has 'advanced_editor'
permission
6 - Confirm borrowers can access advanced editor as above
7 - Remove 'advanced_editor' permission from borrower
8 - Ensure they cannot access the advanced editor
9 - Ensure links to 'Edit record' from search results go to basic editor

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 5 Martin Renvoize 2019-03-12 13:53:38 UTC
Yeay for bug 22031 and it's first real use here :)

All works as expected.. I had to do a minor rebase to get it to apply again.

Passing QA
Comment 6 Nick Clemens 2019-03-16 13:45:51 UTC
Created attachment 86706 [details] [review]
Bug 20128: Add permission for advanced cataloging editor

To test:
1 - Have a borrower with edit_catalogue permission and one with
editcatalogue top level
2 - Confirm they can both access the advanced editor from the
'Cataloguing' home page or from the basic editor
3 - Apply patch
4 - Update database
5 - Confirm borrower with 'edit_catalogue' has 'advanced_editor'
permission
6 - Confirm borrowers can access advanced editor as above
7 - Remove 'advanced_editor' permission from borrower
8 - Ensure they cannot access the advanced editor
9 - Ensure links to 'Edit record' from search results go to basic editor

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 7 Nick Clemens 2019-03-16 13:45:54 UTC
Created attachment 86707 [details] [review]
Bug 20128: Problem when checking individual perms where borrower has top level
Comment 8 Nick Clemens 2019-03-16 13:47:08 UTC
(In reply to Nick Clemens from comment #7)
> Created attachment 86707 [details] [review] [review]
> Bug 20128: Problem when checking individual perms where borrower has top
> level

Martin, can you look here, I added a test to highlight the problem. If the user has all 'Edit catalogue' permissions then we get an error
Comment 9 Martin Renvoize 2019-03-21 07:40:27 UTC
Sorry Nick, I hadn't spotted this.. I'm in meetings all day today but will hit it as my first priority on Friday.
Comment 10 Martin Renvoize 2019-03-21 10:20:35 UTC
Created attachment 86840 [details] [review]
Bug 20128: (QA Follow-up) Corrections to haspermission

The haspermission routine wrongly assumed that get_user_subpermissions
would return a list of all subpermissions if the user had the top level
permission, but instead if just returns 1.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Comment 11 Martin Renvoize 2019-03-21 10:26:47 UTC
OK, I found a moment at the beginning of my meeting ;)

I've uploaded one option which uses the existing structure created by get_user_subpermissions, however there is an alternate option we could follow of adapting getuserpermissions to return all subpermissions in a hash if the top level flag is set rather than just returning the boolean 1.
Comment 12 Katrin Fischer 2019-04-10 21:39:55 UTC
Created attachment 87738 [details] [review]
Bug 20128: Add permission for advanced cataloging editor

To test:
1 - Have a borrower with edit_catalogue permission and one with
editcatalogue top level
2 - Confirm they can both access the advanced editor from the
'Cataloguing' home page or from the basic editor
3 - Apply patch
4 - Update database
5 - Confirm borrower with 'edit_catalogue' has 'advanced_editor'
permission
6 - Confirm borrowers can access advanced editor as above
7 - Remove 'advanced_editor' permission from borrower
8 - Ensure they cannot access the advanced editor
9 - Ensure links to 'Edit record' from search results go to basic editor

Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 13 Katrin Fischer 2019-04-10 21:40:00 UTC
Created attachment 87739 [details] [review]
Bug 20128: Problem when checking individual perms where borrower has top level

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 14 Katrin Fischer 2019-04-10 21:40:05 UTC
Created attachment 87740 [details] [review]
Bug 20128: (QA follow-up) Corrections to haspermission

The haspermission routine wrongly assumed that get_user_subpermissions
would return a list of all subpermissions if the user had the top level
permission, but instead if just returns 1.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Comment 15 Katrin Fischer 2019-04-10 21:40:09 UTC
Created attachment 87741 [details] [review]
Bug 20128: Add new permission for new installations

Change was missing from userpermissions.sql
Comment 16 Katrin Fischer 2019-04-10 21:40:30 UTC
Hi Nick, please check my follow-up!
Comment 17 Martin Renvoize 2019-04-11 07:28:20 UTC
Followup looks solid to me Katrin.
Comment 18 Nick Clemens 2019-04-17 12:26:44 UTC
Awesome work all!

Pushed to master for 19.05
Comment 19 Tomás Cohen Arazi 2019-04-17 14:28:34 UTC Comment hidden (obsolete)
Comment 20 Tomás Cohen Arazi 2019-04-17 14:28:38 UTC Comment hidden (obsolete)
Comment 21 Martin Renvoize 2019-04-26 13:24:18 UTC
Enhancement will not be backported to 18.11.x series.