Skip to content
This repository was archived by the owner on Mar 18, 2021. It is now read-only.

Conversation

@whunter
Copy link
Member

@whunter whunter commented Jan 29, 2021

Prevent non-admin users from creating collections and items. And add notice to that effect.


JIRA Ticket:
(https://webapps.es.vt.edu/jira/browse/LIBTD-2411)
(https://webapps.es.vt.edu/jira/browse/LIBTD-2413)
(:star:)

  • Other Relevant Links (Meeting note, project page, related pull requests, etc.)

What does this Pull Request do? (:star:)

Prevent non-admin users from creating collections and items. And add notice to that effect

What's the changes? (:star:)

  • Remove ability for non-admins to create stuff in models/ability.rb
  • Redirect from GenericFiles#new and Collections#new in controllers if non-admin
  • Add message to let users know of this change in layout files.
  • Style message to help it get noticed by users a little better.

How should this be tested?

  • Check that the new message shows up just below the header.
  • Login as non-admin
  • Go to dashboard page and try to upload a file to create a GenericFile record and try to create a Collection. You should be redirected back to the dashboard page in both cases
  • Login as admin
  • Go to dashboard page and try to upload a file to create a GenericFile record and try to create a Collection. You should be able to do this successfully.

Additional Notes:

  • branch: LIBTD-2413

Interested parties

@yinlinchen
@pmather

(:star:) Required fields

prevent non-admins from creating new content. add notice to that effect
@whunter whunter requested review from pmather and yinlinchen January 29, 2021 21:08
@yinlinchen
Copy link
Member

LGTM. Thanks for the quick fix! @pmather Feel free to merge if you would like

Copy link
Member

@yinlinchen yinlinchen left a comment

Choose a reason for hiding this comment

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

👍

@whunter
Copy link
Member Author

whunter commented Feb 1, 2021

@yinlinchen @pmather I added redirects to all dashboard pages for non-admins. I also added them to the individual edit pages, just for the off chance that someone had a direct link to them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants