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

Create permissions service layer #2115

Merged
merged 11 commits into from
Jan 8, 2025
Merged

Conversation

jjnesbitt
Copy link
Member

The goal of this PR is to abstract most of the use of django-guardian into the permissions service layer, instead exposing functions that achieve the same effect. This has the following benefits:

  1. Consolidates permission logic in the application, most notably used in endpoints.
  2. Allows for easier modification or extension of our permissions logic.

One notable use case for this is forks of the codebase that may need to modify how permissions are done (e.g. LINC). This refactor and consolidation makes that much easier, as everything can be easily found in one file. cc @aaronkanzer.

dandiapi/api/models/dandiset.py Outdated Show resolved Hide resolved
dandiapi/api/services/permissions/dandiset.py Outdated Show resolved Hide resolved
dandiapi/api/services/permissions/dandiset.py Show resolved Hide resolved
dandiapi/api/views/asset.py Show resolved Hide resolved
dandiapi/api/services/permissions/dandiset.py Show resolved Hide resolved
@jjnesbitt jjnesbitt added patch Increment the patch version when merged release Create a release when this pr is merged labels Jan 3, 2025
@jjnesbitt jjnesbitt merged commit 0a42f56 into master Jan 8, 2025
11 checks passed
@jjnesbitt jjnesbitt deleted the permissions-service-layer branch January 8, 2025 18:09
@dandibot
Copy link
Member

dandibot commented Jan 8, 2025

🚀 PR was released in v0.4.6 🚀

@dandibot dandibot added the released This issue/pull request has been released. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
patch Increment the patch version when merged release Create a release when this pr is merged released This issue/pull request has been released.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants