-
Notifications
You must be signed in to change notification settings - Fork 14
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
(api) Add option to enforce use of scopes (all/read
, all/write
, etc.)
#463
(api) Add option to enforce use of scopes (all/read
, all/write
, etc.)
#463
Conversation
d178685
to
1783ff8
Compare
3b2e3c1
to
401db9e
Compare
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.
LGTM! 🎉
Note that it could be nice to add or link the list of scopes defined by adlnet LRS specification, maybe in another PR?
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.
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.
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.
8c1968e
to
34c8413
Compare
Added here: https://github.com/openfun/ralph/blob/bd6fcb615e3a5cba536505f8a6448c234696f369/docs/api.md#scopes ! |
The current state of Ralph allows to restrict users by authority, but does not allow a/An admin user b/Finer access control (read, write). This PR aims to solve this issue by implementing `RESTRICT_BY_SCOPES` (`scopes` field is already present in user accounts) which restricts access when enabled.
bd6fcb6
to
df62058
Compare
Purpose
The current state of Ralph allows to restrict users by authority, but does not allow 1. An admin user 2. Finer access control (read, write). This PR aims to solve this issue by implementing
scopes
(a field already present in user accounts) which can allow restricted access.Proposal
The scopes proposed are a slight variation on the scopes defined by the xAPI standard:
NB: This PR also proposes some cleaning (renaming tests and factorizing code in tests).
TODO:
RALPH_LRS_RESTRICT_BY_SCOPE
)statements/read/mine
scope (RALPH_LRS_RESTRICT_BY_AUTHORITY
must be used) (specific test !)LRS_RESTRICT_BY_AUTHORITY==True
if using scopes, and test this behavior