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

SF-3076 Simplify guest role sharing settings #2858

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

Conversation

pmachapman
Copy link
Collaborator

@pmachapman pmachapman commented Nov 18, 2024

This PR updates the sharing functionality to be configured via a simplified interface in Settings.

To achieve this, the following modifications were made to the Scripture Forge codebase:

  • Implementation of a rolePermissions property in sf_project (similar to userPermissions but per role).
  • Sharing of default rights-by-role via the JSON file rightsByRole.json which is loaded into TypeScript (in the RealtimeServer and Frontend) and C# (dotnet backend).
  • Implementation of SFProjectRole and Operation in C# to allow permissions to be strongly typed.
    • Note: I am considering a future PR that will use DefinitelyTyped to have these data structures defined just once (in C#) then autogenerated as TypeScript enums. To stop this PR growing any further, I have not included that in this PR.
  • Sharing code between ShareDialogComponent and ShareControlComponent via ShareBaseComponent.
  • Organization of the MongoDB migration scripts into the directory mongodb/Migrations/
  • Improved test coverage of related code, and fixed erroneous Realtime Server unit tests.

These changes have made this PR considerably larger than originally envisaged, but the goal is a simplification and unification of permission calculations which should make future PRs with permissions simpler.

Notes

  • Before running this code, you will need to run the MongoDB migration script mongodb/Migrations/20241127-AddCreatedByRoleToShareKeys.mongodb

Design Mock Up

image


This change is Reviewable

Copy link

codecov bot commented Nov 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.62%. Comparing base (9b92c3e) to head (871c558).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2858      +/-   ##
==========================================
+ Coverage   79.19%   79.62%   +0.43%     
==========================================
  Files         533      535       +2     
  Lines       30962    31063     +101     
  Branches     5052     5063      +11     
==========================================
+ Hits        24520    24735     +215     
+ Misses       5668     5556     -112     
+ Partials      774      772       -2     

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

@pmachapman pmachapman force-pushed the fix/SF-3076 branch 2 times, most recently from 6065844 to 36f65f3 Compare November 26, 2024 23:38
@pmachapman pmachapman changed the title WIP: SF-3076 Simplify guest role sharing settings SF-3076 Simplify guest role sharing settings Nov 27, 2024
@pmachapman pmachapman added the will require testing PR should not be merged until testers confirm testing is complete label Nov 27, 2024
@pmachapman pmachapman marked this pull request as ready for review November 27, 2024 00:30
@kylebuss kylebuss assigned kylebuss and unassigned kylebuss Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
will require testing PR should not be merged until testers confirm testing is complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants