Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BXC-4216 - Patron Role/Permission for accessing reduced quality images #1653

Merged
merged 13 commits into from
Jan 12, 2024

Conversation

bbpennel
Copy link
Member

@bbpennel bbpennel commented Jan 11, 2024

https://unclibrary.atlassian.net/browse/BXC-4316

  • Introduces canViewReducedQuality patron role and associated canViewReducedResImages permission
    • Adds new property URI for the role
  • For file record pages, if the user can access any download options (low res or original) then the download button will appear instead of the restricted content block.
  • Download dropdown will now display for images if the user has viewReducedResImages permission, but will not show full size or original download options
  • DownloadImage controller now uses new permission for enforcement when downloading images below the max size
  • Refactoring of UserRole object to reduce repetition of permissions, remove unused methods, and add test coverage
  • Removed a number of unused permission related methods
  • Disables a codeclimate check that was requiring enums to be named like constants, since we have a lot of existing enums that don't follow that convention.

…role. Remove unused methods. Add test coverage. Refactor roles to inherit permissions from each other, since almost all of them build off another role
…ucedResImages is granted, and only show full size and original when viewOriginals granted. Update tests to include new permission
… CdrAcl property. Add additional tests to verify new permission works during evaluation and setting
…ow res or original) then the download button will appear instead of the restricted content block. Add additional restrictedContent tests to verify this, check the dropdown has the right options, and some refactoring to DRY up code
…ra test to verify new permission works in patron settings
<a class="button view action" :href="recordData.dataFileUrl">
<i class="fa fa-search" aria-hidden="true"></i> View</a>
</div>
<template v-if="hasPermission(recordData, 'viewOriginal')">
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should be able to put the v-if on <div class="actionlink">. I'm not sure why I did it this way, but it's not a big deal either way.

…umber of templates in restrictedContent.vue based on feedback
@lfarrell lfarrell merged commit 4b6d92d into main Jan 12, 2024
5 checks passed
@lfarrell lfarrell deleted the bxc-4316-lowres branch January 12, 2024 13:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants