For single patrons and for patches we should allow the superlibrarian to set/update password expiration dates
Created attachment 130551 [details] [review] Bug 29926: Add pasword expiration route for API To test: 1 - prove -v t/db_dependent/api/v1/patrons_password_expiration.t
Created attachment 130552 [details] [review] Bug 29926: Add ability for superlibrarian to view/edit password expiration To test: 1 - Sign in as a superlibrarian 2 - Find a patron account with no password expiration set 3 - View member detials 4 - note expiration says 'Never' 5 - Edit patron 6 - Set patron expiration 7- Save 8 - View details, confirm password expiration shows correctly 9 - Sign in as non-superlibrarian 10 - Confirm you don't see expirationdate on details page 11 - Edit patron and confirm password expiration does not show 12 - Edit HTML and confirm you epxiration date not saved <input type="text" name="password_expiration_date" value="2052-05-02">
Created attachment 130553 [details] [review] Bug 29926: Add ability for superlibrarians to batch edit password expiration dates To test: 1 - Sign in as a superlibrarian 2 - Tools->Batch patron modification 3 - Add patrons with and without pasword expiration set 4 - Confirm dates display correctly on modification page, or show never 5 - Check the box to delete all dates 6 - Confirm patrons now show 'Never' 7 - Edit patrons again, set a date 8 - Confirm date is set correctly 9 - Sign in as a user with catalogue/tools/borrowers permissions, but not superlibrarian 10 - Confirm y9ou do not see, and cannnot edit password expiration dates
Created attachment 130686 [details] [review] Bug 29926: Add pasword expiration route for API To test: 1 - prove -v t/db_dependent/api/v1/patrons_password_expiration.t Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 130687 [details] [review] Bug 29926: Add ability for superlibrarian to view/edit password expiration To test: 1 - Sign in as a superlibrarian 2 - Find a patron account with no password expiration set 3 - View member detials 4 - note expiration says 'Never' 5 - Edit patron 6 - Set patron expiration 7- Save 8 - View details, confirm password expiration shows correctly 9 - Sign in as non-superlibrarian 10 - Confirm you don't see expirationdate on details page 11 - Edit patron and confirm password expiration does not show 12 - Edit HTML and confirm you epxiration date not saved <input type="text" name="password_expiration_date" value="2052-05-02"> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 130688 [details] [review] Bug 29926: Add ability for superlibrarians to batch edit password expiration dates To test: 1 - Sign in as a superlibrarian 2 - Tools->Batch patron modification 3 - Add patrons with and without pasword expiration set 4 - Confirm dates display correctly on modification page, or show never 5 - Check the box to delete all dates 6 - Confirm patrons now show 'Never' 7 - Edit patrons again, set a date 8 - Confirm date is set correctly 9 - Sign in as a user with catalogue/tools/borrowers permissions, but not superlibrarian 10 - Confirm y9ou do not see, and cannnot edit password expiration dates Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
The patch currently doesn't apply, can you please fix? Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 29926: Add pasword expiration route for API Using index info to reconstruct a base tree... A api/v1/swagger/paths.yaml Falling back to patching base and 3-way merge... CONFLICT (modify/delete): api/v1/swagger/paths.yaml deleted in HEAD and modified in Bug 29926: Add pasword expiration route for API. Version Bug 29926: Add pasword expiration route for API of api/v1/swagger/paths.yaml left in tree. error: Failed to merge in the changes. Patch failed at 0001 Bug 29926: Add pasword expiration route for API hint: Use 'git am --show-current-patch=diff' to see the failed patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-29926-Add-pasword-expiration-route-for-API-QJheMn.patch Wondering: This is kind of an "undocumented" extra for the superlibrarians, that is not covered by any of the permissions. How can we document or should this not better be a new permission?
Created attachment 133759 [details] [review] Bug 29926: Add pasword expiration route for API To test: 1 - prove -v t/db_dependent/api/v1/patrons_password_expiration.t Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 133760 [details] [review] Bug 29926: Add ability for superlibrarian to view/edit password expiration To test: 1 - Sign in as a superlibrarian 2 - Find a patron account with no password expiration set 3 - View member detials 4 - note expiration says 'Never' 5 - Edit patron 6 - Set patron expiration 7- Save 8 - View details, confirm password expiration shows correctly 9 - Sign in as non-superlibrarian 10 - Confirm you don't see expirationdate on details page 11 - Edit patron and confirm password expiration does not show 12 - Edit HTML and confirm you epxiration date not saved <input type="text" name="password_expiration_date" value="2052-05-02"> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 133761 [details] [review] Bug 29926: Add ability for superlibrarians to batch edit password expiration dates To test: 1 - Sign in as a superlibrarian 2 - Tools->Batch patron modification 3 - Add patrons with and without pasword expiration set 4 - Confirm dates display correctly on modification page, or show never 5 - Check the box to delete all dates 6 - Confirm patrons now show 'Never' 7 - Edit patrons again, set a date 8 - Confirm date is set correctly 9 - Sign in as a user with catalogue/tools/borrowers permissions, but not superlibrarian 10 - Confirm y9ou do not see, and cannnot edit password expiration dates Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org>
Created attachment 133887 [details] [review] Bug 29926: Add pasword expiration route for API To test: 1 - prove -v t/db_dependent/api/v1/patrons_password_expiration.t Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133888 [details] [review] Bug 29926: Add ability for superlibrarian to view/edit password expiration To test: 1 - Sign in as a superlibrarian 2 - Find a patron account with no password expiration set 3 - View member detials 4 - note expiration says 'Never' 5 - Edit patron 6 - Set patron expiration 7- Save 8 - View details, confirm password expiration shows correctly 9 - Sign in as non-superlibrarian 10 - Confirm you don't see expirationdate on details page 11 - Edit patron and confirm password expiration does not show 12 - Edit HTML and confirm you epxiration date not saved <input type="text" name="password_expiration_date" value="2052-05-02"> Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133889 [details] [review] Bug 29926: Add ability for superlibrarians to batch edit password expiration dates To test: 1 - Sign in as a superlibrarian 2 - Tools->Batch patron modification 3 - Add patrons with and without pasword expiration set 4 - Confirm dates display correctly on modification page, or show never 5 - Check the box to delete all dates 6 - Confirm patrons now show 'Never' 7 - Edit patrons again, set a date 8 - Confirm date is set correctly 9 - Sign in as a user with catalogue/tools/borrowers permissions, but not superlibrarian 10 - Confirm y9ou do not see, and cannnot edit password expiration dates Signed-off-by: Bob Bennhoff <bbennhoff@clicweb.org> Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133890 [details] [review] Bug 29926: (QA follow-up) API design fixes This patch makes the following changes to the spec: * Password being the resource and expiration_date an attribute for it, so reorganizing things and also renaming the route. * Be it undefined or defined, expiration date is only one and thus should use the PUT verb (as in overwrite). * Minor bug 30194-related fixes. Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Created attachment 133891 [details] [review] Bug 29926: (QA follow-up) Date format missing in spec On fixing the spec to have `format: date` I noticed the tests were expecting explosions because of date handling not being done. The OpenAPI plugin does this correctly when you set the format right. So, I adapted the tests so they expect 400 and return the type error. We don't usually add such tests (i.e. test the plugin does its job correctly) but it doesn't hurt to keep them just in case something really changes badly there (plugin bug?). Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Pushed to master for 22.05, thanks to everybody involved [U+1F984]