Skip to content

Conversation

klpoland
Copy link
Collaborator

@klpoland klpoland commented Aug 29, 2025

This contains ONLY updates to the sharing mechanism, allowing users to:

  • Select different sharing access levels
  • Update shared users/groups access (downgrade, upgrade, remove)
  • Adds back-end functionality for access control (on another branch to be merged into this one)
  • Updated UI to accommodate new access levels

Changes to write privileges on the dataset editing page are on a branch checked out from this one and can be merged into this branch when these are approved (keeping all the changes together would make this a difficult to review PR so I separated them).

@klpoland klpoland self-assigned this Aug 29, 2025
@klpoland klpoland added feature New feature or request refactoring General code improvements gateway Gateway component styling Special focus on styling of front-end components javascript Pull requests that update javascript code labels Aug 29, 2025
@klpoland klpoland requested a review from lucaspar September 10, 2025 12:54
@klpoland klpoland marked this pull request as ready for review September 10, 2025 12:54
@klpoland klpoland force-pushed the feature-kpoland-access-levels branch from 819bf6a to 5871fdf Compare September 10, 2025 12:55
Copy link
Member

Choose a reason for hiding this comment

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

this file uses self.assertEqual, self.assertTrue, self.assertFalse, and self.assertIn from unittest classes; I think we should stick to simple assert statements for consistency. This also has a little syntax highlighting bonus for using a reserved word in Python.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah, noticed this when refactoring, I'll fix that here. haven't run the pre-commit hooks on this branch yet.

@lucaspar lucaspar requested a review from Copilot September 10, 2025 22:38
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements a comprehensive access level system for sharing datasets and captures with different permission levels. Users can now assign "Viewer," "Contributor," or "Co-Owner" permissions to shared users and groups, providing granular control over what actions shared users can perform.

  • Added three permission levels (Viewer, Contributor, Co-Owner) with specific capabilities for each
  • Updated sharing UI with permission level selection and management functionality
  • Refactored backend sharing logic to handle permission updates and changes
  • Added extensive test coverage for permission checking and updates

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 9 comments.

Show a summary per file
File Description
gateway/sds_gateway/users/views.py Refactored ShareItemView to handle unified sharing operations including permission changes and removals
gateway/sds_gateway/users/utils.py Updated group sharing utility to support permission levels
gateway/sds_gateway/templates/users/partials/share_modal.html Enhanced UI with permission level dropdowns and Google Drive-style access controls
gateway/sds_gateway/static/js/userSearchComponent.js Added permission level handling to user search and chip rendering
gateway/sds_gateway/static/js/permission-levels.js New JavaScript module for permission level management and UI interactions
gateway/sds_gateway/static/css/permission-levels.css Comprehensive styling for permission level components and visual feedback
gateway/sds_gateway/api_methods/models.py Extended UserSharePermission model with permission checking methods and dataset author management

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@klpoland klpoland force-pushed the feature-kpoland-access-levels branch from 5871fdf to 598eca5 Compare September 19, 2025 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request gateway Gateway component javascript Pull requests that update javascript code refactoring General code improvements styling Special focus on styling of front-end components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants