From 710761251a23471ec3773a42cf9ea4c736d4a153 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Tue, 14 Nov 2023 13:43:45 +0500 Subject: [PATCH 1/3] sync auth roles updated --- README.rst | 4 ++++ tutorcairn/plugin.py | 2 ++ tutorcairn/templates/cairn/apps/superset/superset_config.py | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 0e053f8..5508cbc 100644 --- a/README.rst +++ b/README.rst @@ -126,6 +126,10 @@ To add the default dashboards to the new user, add the ``--bootstrap-dashboards` tutor local do cairn-createuser --course-id='course-v1:edX+DemoX+Demo_Course' YOURUSERNAME YOURUSERNAME@YOUREMAIL.COM +By default, AUTH_ROLES_SYNC_AT_LOGIN is False which means admin can customize the permissions associated to a user. To disable this behaviour, modify the ``CAIRN_AUTH_ROLES_SYNC_AT_LOGIN`` setting:: + + tutor config save --set CAIRN_AUTH_ROLES_SYNC_AT_LOGIN=True + tutor local restart Refreshing course block data ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/tutorcairn/plugin.py b/tutorcairn/plugin.py index 09c830b..9c9d81f 100644 --- a/tutorcairn/plugin.py +++ b/tutorcairn/plugin.py @@ -55,6 +55,8 @@ hooks.Filters.CONFIG_DEFAULTS.add_items( # https://hub.docker.com/r/timberio/vector/tags # https://github.com/vectordotdev/vector/releases ("CAIRN_VECTOR_DOCKER_IMAGE", "docker.io/timberio/vector:0.25.1-alpine"), + #Auto sync user roles + ("CAIRN_AUTH_ROLES_SYNC_AT_LOGIN", False), ] ) diff --git a/tutorcairn/templates/cairn/apps/superset/superset_config.py b/tutorcairn/templates/cairn/apps/superset/superset_config.py index 6035963..0ca6a92 100644 --- a/tutorcairn/templates/cairn/apps/superset/superset_config.py +++ b/tutorcairn/templates/cairn/apps/superset/superset_config.py @@ -106,7 +106,7 @@ OAUTH_PROVIDERS = [ CUSTOM_SECURITY_MANAGER = cairn_sso.OpenEdxSsoSecurityManager # Update roles on login: this will cause all roles (except those that are preserved) to # be ovewritten. -AUTH_ROLES_SYNC_AT_LOGIN = True +AUTH_ROLES_SYNC_AT_LOGIN = {{ CAIRN_AUTH_ROLES_SYNC_AT_LOGIN }} # Login will create user AUTH_USER_REGISTRATION = True {% endif %} From 5853b16b169588db93c9eb7210ae29715fc7cde8 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Tue, 14 Nov 2023 16:55:22 +0500 Subject: [PATCH 2/3] improved readme --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5508cbc..8a7fb7e 100644 --- a/README.rst +++ b/README.rst @@ -128,7 +128,7 @@ To add the default dashboards to the new user, add the ``--bootstrap-dashboards` By default, AUTH_ROLES_SYNC_AT_LOGIN is False which means admin can customize the permissions associated to a user. To disable this behaviour, modify the ``CAIRN_AUTH_ROLES_SYNC_AT_LOGIN`` setting:: - tutor config save --set CAIRN_AUTH_ROLES_SYNC_AT_LOGIN=True + tutor config save --set CAIRN_AUTH_ROLES_SYNC_AT_LOGIN=true tutor local restart Refreshing course block data From 3050ba0b68d7b2122f3c98acec70955b41777bb2 Mon Sep 17 00:00:00 2001 From: FahadKhalid210 Date: Wed, 15 Nov 2023 15:00:19 +0500 Subject: [PATCH 3/3] added changlog entry --- changelog.d/20231115_145643_fahad.khalid_fahad_cairn_14.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 changelog.d/20231115_145643_fahad.khalid_fahad_cairn_14.md diff --git a/changelog.d/20231115_145643_fahad.khalid_fahad_cairn_14.md b/changelog.d/20231115_145643_fahad.khalid_fahad_cairn_14.md new file mode 100644 index 0000000..71ea8aa --- /dev/null +++ b/changelog.d/20231115_145643_fahad.khalid_fahad_cairn_14.md @@ -0,0 +1 @@ +- 💥[Improvement] Superset auto_sync roles updated. (by @FahadKhalid210)