-
Notifications
You must be signed in to change notification settings - Fork 0
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: enable OAuth2 per View #148
Conversation
7159f08
to
6629310
Compare
aba799e
to
d3d4671
Compare
:param cls: The class to register | ||
:type cls: Any | ||
""" | ||
def _hacky_update_django_admin_choices(choices: list[tuple[str, str]]) -> None: |
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 had to do it like this because CourseAccessRoleForm
class of edx-platform
is always declared before our extension
@@ -34,6 +38,123 @@ class Meta: | |||
unique_together = ('view_name', 'allowed_role') | |||
|
|||
|
|||
class ViewUserMappingManager(models.Manager): # pylint: disable=too-few-public-methods |
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.
ViewUserMappingManager
is needed to allow smooth UX in django-admin when sorting and filtering on column values
d3d4671
to
e43d45f
Compare
Thanks @shadinaif, let's discuss it tomorrow in our 1-1 |
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.
Looks good to me, also did quick testing on stage.
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.
çok güzel! okudum anladım kabul ettim :)
e43d45f
to
903da3f
Compare
fx_api_access_role_global
: acts as a global role. It grants access to all tenants for the permitted viewfx_api_access_role
: acts as a tenant-wide or course-specific role. It grants limited access to the permitted view/admin/fx_helpers/viewusermapping/
usable
flag that tells the admin if the record permits the related user to access the view or notBearerAuthentication
toauthentication_classes
for all views of the extenstion. This will automatically allow OAuth2 to all views, but the extension will use the View-User-Mapping as an extra security layer to control the access per tenant or courseApplication
in django-oauth2-provider form/admin/oauth2_provider/application/
(Authorization grant type: Confidential,
Authorization grant type:Client Credentials
)Sample screenshot of the admin page: