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

Update project permissions without having to log out and back in #2952

Merged
merged 9 commits into from
Apr 17, 2024

Conversation

imnasnainaec
Copy link
Collaborator

@imnasnainaec imnasnainaec commented Feb 16, 2024

Move project permission checking out of JWT token
Fixes #2949


This change is Reviewable

@imnasnainaec imnasnainaec added bug Something isn't working backend project labels Feb 16, 2024
@imnasnainaec imnasnainaec self-assigned this Feb 16, 2024
Copy link

codecov bot commented Feb 16, 2024

Codecov Report

Attention: Patch coverage is 75.00000% with 6 lines in your changes are missing coverage. Please review.

Project coverage is 74.94%. Comparing base (278c72d) to head (278cbf1).

❗ Current head 278cbf1 differs from pull request most recent head 5e1b2d6. Consider uploading reports for the commit 5e1b2d6 to get more accurate results

Files Patch % Lines
Backend/Services/PermissionService.cs 70.00% 3 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2952      +/-   ##
==========================================
+ Coverage   74.69%   74.94%   +0.24%     
==========================================
  Files         269      269              
  Lines       10374    10348      -26     
  Branches     1229     1226       -3     
==========================================
+ Hits         7749     7755       +6     
+ Misses       2268     2235      -33     
- Partials      357      358       +1     
Flag Coverage Δ
backend 83.97% <75.00%> (+0.55%) ⬆️
frontend 66.60% <ø> (ø)

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.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

Reviewed 3 of 4 files at r1, all commit messages.
Reviewable status: 3 of 4 files reviewed, all discussions resolved (waiting on @imnasnainaec)


Backend.Tests/Services/PermissionServiceTests.cs line 104 at r1 (raw file):

            var user = new User();
            var httpContext = CreateHttpContextWithUser(user);
            var userRole = _userRoleRepo.Create(new UserRole { ProjectId = ProjId, Role = Role.None }).Result;

I feel like Role.None could be handled as a a special case, so I think this test would be better if it used the harvester role.

Copy link
Contributor

@jasonleenaylor jasonleenaylor left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @imnasnainaec)

@imnasnainaec imnasnainaec merged commit e72e2eb into master Apr 17, 2024
18 checks passed
@imnasnainaec imnasnainaec deleted the user-perms branch April 17, 2024 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend bug Something isn't working project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users added to a project have to log out and back in before they can access it
2 participants