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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor scopes for project services #9156

Merged
merged 9 commits into from Nov 1, 2023
Merged

Conversation

aditya-mitra
Copy link
Collaborator

@aditya-mitra aditya-mitra commented Oct 27, 2023

Summary

馃 Generated by Copilot at 3a35966

This pull request updates the scope requirements and the hook logic for various project-related services in the server-core package. It uses the checkScope function and the iff and isProvider functions from feathers-hooks-common to improve the security and flexibility of the services. It also modifies the tests and the publish function to reflect the scope changes. The main services affected are project-build, project-invalidate, project-permission, project, scene-upload, project-github-push, and scene.

References

refs #9161

Explanation

馃 Generated by Copilot at 3a35966

  • Use iff and isProvider functions to check external provider and scope for project-related services (link, link, link, link, link, link, link, link)
  • Use checkScope function to check user permissions for projects and project permissions (link, link, link, link, link)
  • Change scope requirements from admin:admin or editor:write to projects:read, projects:write, or scene:write for various project-related services and functions (link, link, link, link, link, link, link, link, link, link, link, link)
  • Remove unnecessary await keyword from ensurePushStatus function in project.hooks.ts (link)
  • Remove empty comment line from checkExistingPermissions function in project-permission.hooks.ts (link)
  • Add condition to ensureOwnership function in project-permission.hooks.ts to allow users with projects:read scope to access project permissions (link)

馃 Generated by Copilot at 3a35966

We are the masters of the scope
We check and verify every request
We use the hooks to guard our code
We are the feathers of the project

QA Steps

List any additional steps required to QA the changes of this PR, as well as any supplemental images or videos.

Checklist

  • If this PR is still a WIP, convert to a draft
  • When this PR is ready, mark it as "Ready for review"
  • ensure all checks pass
  • Changes have been manually QA'd
  • Changes reviewed by at least 2 approved reviewers

@aditya-mitra aditya-mitra marked this pull request as ready for review October 30, 2023 11:30
@barankyle barankyle added this pull request to the merge queue Nov 1, 2023
Merged via the queue into dev with commit 4456303 Nov 1, 2023
13 checks passed
@barankyle barankyle deleted the refactor/project-scoping branch November 1, 2023 23:04
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

3 participants