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

Fixed file uploads for accessories, components, and consumables #12370

Merged
merged 11 commits into from
Jan 19, 2023

Conversation

marcusmoore
Copy link
Collaborator

@marcusmoore marcusmoore commented Jan 18, 2023

Description

This PR adds the previously missing file upload tab and file upload button on the accessories, components, and consumables show pages for users that have the ability to view and modify files for those respective entities. For non-super-users this means the following permissions have been granted:

  • View and Modify Accessory Files
  • View and Modify Component Files
  • View and Modify Consumable Files

This is accomplished by registering the gates that are already being checked in the templates:

  • accessories.files
  • components.files
  • consumables.files

In addition, minor template changes were made on the accessory show page so the bottom bar is constrained to the content area, and the layout is consistent for users regardless of if they have access to accessory files.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Before and After

Assuming the user has been granted the "View and Modify x Files" mentioned above.

Accessories

Before After
Accessories before Accessories after

Components

Before After
Components before Components after

Consumables

Before After
Consumables before Consumables after

@what-the-diff
Copy link

what-the-diff bot commented Jan 18, 2023

  • Added new permissions for accessories, components and consumables.
  • Updated the view files to use these new permissions instead of using update permission on each model class directly.

@marcusmoore marcusmoore marked this pull request as ready for review January 19, 2023 00:06
@snipe snipe merged commit 155977d into snipe:develop Jan 19, 2023
@welcome
Copy link

welcome bot commented Jan 19, 2023

Congrats on merging your first pull request! 🎉🎉🎉

@snipe
Copy link
Owner

snipe commented Jan 19, 2023

This PR is gorgeous - thank you!

@marcusmoore marcusmoore deleted the fix/file-upload-tab-permissions branch January 19, 2023 17:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants