-
-
Notifications
You must be signed in to change notification settings - Fork 5
SF-3637 Deduplicate permissions #3566
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
base: master
Are you sure you want to change the base?
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3566 +/- ##
==========================================
- Coverage 82.90% 82.89% -0.01%
==========================================
Files 605 605
Lines 36974 36992 +18
Branches 6058 6064 +6
==========================================
+ Hits 30652 30665 +13
+ Misses 5408 5401 -7
- Partials 914 926 +12 ☔ View full report in Codecov by Sentry. |
fd922d7 to
cab2950
Compare
cab2950 to
7efc714
Compare
RaymondLuong3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did some testing and when I updated the roles in PT for books and chapters they were working as expected.
@RaymondLuong3 reviewed 15 of 17 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: all files reviewed, 5 unresolved discussions (waiting on @pmachapman)
src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts line 524 at r2 (raw file):
get showNoEditPermissionMessage(): boolean { return this.userHasGeneralEditRight && this.hasChapterEditPermission === false; }
This message doesn't work when the user has no permission on the book. Since it is assumed that books have an implicit read level permission, then hasChapterEditPermission is undefined. I think textDocService should be updated.
Code quote:
get showNoEditPermissionMessage(): boolean {
return this.userHasGeneralEditRight && this.hasChapterEditPermission === false;
}src/SIL.XForge.Scripture/ClientApp/src/app/translate/editor/editor.component.ts line 530 at r2 (raw file):
} get hasSourceViewRight(): boolean {
It is so nice to see redundant code cleaned up!
Code quote:
get hasSourceViewRight(): boolean {src/SIL.XForge.Scripture/Services/ParatextService.cs line 1696 at r2 (raw file):
} public async Task<SyncMetricInfo> UpdateParatextPermissionsForNewBooksAsync(
Could you add a description here. That would help better understand what the different parameters mean. It isn't clear to me what "writeToParatext" means.
Code quote:
public async Task<SyncMetricInfo> UpdateParatextPermissionsForNewBooksAsync(src/SIL.XForge.Scripture/ClientApp/src/app/core/permissions.service.ts line 71 at r2 (raw file):
// Ensure the user has project level permission to view the text if ( textDocId != null &&
I don't see a reason why textDocId should be optional. At a minimum the textDocId should be defined
Code quote:
if (
textDocId != null &&
This PR deduplicates permissions by:
For some projects on my dev machine, this has reduced the document size by a third. I think for popular resources, like the NIV on production, the document size reduction will be much more substantial.
This change is