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

feat(server): doc level permission #9760

Open
wants to merge 1 commit into
base: canary
Choose a base branch
from

Conversation

Brooooooklyn
Copy link
Member

@Brooooooklyn Brooooooklyn commented Jan 17, 2025

Copy link
Member Author


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@github-actions github-actions bot added app:server test Related to test cases labels Jan 17, 2025
Copy link

codecov bot commented Jan 17, 2025

Codecov Report

Attention: Patch coverage is 46.00666% with 649 lines in your changes missing coverage. Please review.

Project coverage is 44.01%. Comparing base (4b549e0) to head (3544036).

Files with missing lines Patch % Lines
...ckend/server/src/core/workspaces/resolvers/page.ts 37.04% 260 Missing ⚠️
...ages/backend/server/src/core/permission/service.ts 12.58% 132 Missing ⚠️
...ckages/backend/server/src/core/permission/types.ts 63.15% 119 Missing ⚠️
.../server/src/core/workspaces/resolvers/workspace.ts 49.05% 54 Missing ⚠️
packages/backend/server/src/models/workspace.ts 6.25% 15 Missing ⚠️
...ckages/backend/server/src/base/error/errors.gen.ts 83.05% 10 Missing ⚠️
...ckend/server/src/core/workspaces/resolvers/team.ts 9.09% 10 Missing ⚠️
...ges/backend/server/src/plugins/payment/resolver.ts 9.09% 10 Missing ⚠️
packages/backend/server/src/models/page.ts 25.00% 6 Missing ⚠️
...ges/backend/server/src/plugins/copilot/resolver.ts 0.00% 5 Missing ⚠️
... and 11 more
Additional details and impacted files
@@            Coverage Diff             @@
##           canary    #9760      +/-   ##
==========================================
- Coverage   53.54%   44.01%   -9.53%     
==========================================
  Files        2280     2276       -4     
  Lines      103623   104551     +928     
  Branches    17182    16022    -1160     
==========================================
- Hits        55480    46018    -9462     
- Misses      46763    57190   +10427     
+ Partials     1380     1343      -37     
Flag Coverage Δ
server-test 48.77% <46.00%> (-28.86%) ⬇️
unittest 31.90% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch 2 times, most recently from c42b7dc to ffd76bd Compare January 20, 2025 15:26
@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch from ffd76bd to a64a5c7 Compare January 21, 2025 08:11
@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch 2 times, most recently from d3a2fd1 to f7c3a2d Compare January 21, 2025 15:02
@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch 5 times, most recently from f0e5e23 to e169b26 Compare January 22, 2025 09:24
@Brooooooklyn Brooooooklyn marked this pull request as ready for review January 22, 2025 09:24
@graphite-app graphite-app bot requested review from a team January 22, 2025 09:24
@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch from e169b26 to 207047a Compare January 22, 2025 09:27
@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch 2 times, most recently from 3d1b149 to 3aa0297 Compare January 22, 2025 11:12

export const Actions = {
Workspace: {
Sync: 1,
Copy link
Member

Choose a reason for hiding this comment

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

What are the numbers meaning?

Copy link
Member Author

Choose a reason for hiding this comment

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

It refers to the action index in ActionsKeys. Generally, a higher number indicates a more advanced role is required.

role!: DocRole;

@Field(() => RolePermissions)
permissions!: RolePermissions;
Copy link
Member

Choose a reason for hiding this comment

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

this is strange. Workspace permissions will be returned in doc type. If separate them, we could even make code cleaner without 'Doc_' prefix

@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch from 3aa0297 to 8d89c5c Compare January 26, 2025 10:58
@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch 3 times, most recently from 6863843 to 0d7b125 Compare January 27, 2025 04:19
@Brooooooklyn Brooooooklyn force-pushed the 01-11-feat_server_doc_level_permission branch from 0d7b125 to 3544036 Compare January 27, 2025 08:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
app:server test Related to test cases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants