Skip to content

Conversation

@annehaley
Copy link
Collaborator

This PR moves the model-specific logic out of geoinsight/core/rest/access_control.py and into the model definitions. Now each model that has a rest viewset should implement a filter_queryset_by_projects classmethod. The GuardianPermission and GuardianFilter classes leverage those classmethods to determine which objects a user has permission to interact with via the API.

Datasets are an exception; their permission structure is separate from Projects, so a subclass DatasetGuardianPermission is implemented to specify Dataset permissions.

Resolves #208.

@annehaley annehaley requested a review from zachmullen December 1, 2025 21:02
Copy link
Contributor

@zachmullen zachmullen left a comment

Choose a reason for hiding this comment

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

Nice!

@annehaley annehaley merged commit 4635e1b into master Dec 1, 2025
6 checks passed
@annehaley annehaley deleted the refactor-guardian branch December 1, 2025 21:29
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.

Refactor model-specific (or view-specific) logic out of GuardianPermission class

3 participants