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

[dy] Project level permissions with REQUIRE_USER_PERMISSIONS enabled #4919

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

dy46
Copy link
Member

@dy46 dy46 commented Apr 10, 2024

Description

Add project level permissions with REQUIRE_USER_PERMISSIONS enabled. This PR adds entity_scope and entity_scope_id parameters to a Permission model. The entity_scope and entity_scope_id together will identify which "scope" the permission belongs to. For example, if a Permission as entity_scope=project and entity_scope_id=abc123, the permission will only allow a user to access a resource if the resource model belongs to the project with uuid abc123.

How Has This Been Tested?

  • Tested locally by setting entity_scope and entity_scope_id for permissions
  • Bug Bash

Checklist

  • The PR is tagged with proper labels (bug, enhancement, feature, documentation)
  • I have performed a self-review of my own code
  • I have added unit tests that prove my fix is effective or that my feature works
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation

cc: @wangxiaoyou1993

@dy46 dy46 changed the title [WIP][dy] Project level permissions with REQUIRE_USER_PERMISSIONS enabled [dy] Project level permissions with REQUIRE_USER_PERMISSIONS enabled Apr 26, 2024
@dy46 dy46 force-pushed the dy--project_level_permissions branch from 7b78286 to 64b1a2d Compare April 26, 2024 18:55
@dy46 dy46 added bug Something isn't working feature New feature or request and removed bug Something isn't working labels Apr 26, 2024
@dy46 dy46 force-pushed the dy--project_level_permissions branch from 41e2f0e to 4a37ffa Compare April 26, 2024 22:12
@dy46 dy46 marked this pull request as ready for review April 26, 2024 22:12
@dy46 dy46 force-pushed the dy--project_level_permissions branch from 4a37ffa to c8bda78 Compare April 26, 2024 22:27
@wangxiaoyou1993
Copy link
Member

Is this PR ready for review?

@dy46
Copy link
Member Author

dy46 commented May 6, 2024

let me update it a little bit and i'll tag you when it is ready

@dy46 dy46 force-pushed the dy--project_level_permissions branch from c8bda78 to 5bffaee Compare May 6, 2024 22:22
@dy46 dy46 force-pushed the dy--project_level_permissions branch from 9be3cab to d60cf47 Compare May 6, 2024 23:14
@dy46 dy46 requested a review from wangxiaoyou1993 May 6, 2024 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants