nelc / futurex-openedx-extensions

Open edX APIs and reporting tools
Other
0 stars 0 forks source link

security: Prevent non-staff from accessing the NELC dashboard #11

Open OmarIthawi opened 7 months ago

OmarIthawi commented 7 months ago

We need a full /me API to show permissions.

For now we're parsing the edx-user-info and return the following information:

{
    "version": 1,
    "username": "omarithawi_elc",
    "email": "o.ithawi-c@elc.edu.sa",
    "header_urls": {
        "logout": "https://stage.nelp.gov.sa/logout",
        "account_settings": "https://stage.nelp.gov.sa/account/settings",
        "learner_profile": "https://stage.nelp.gov.sa/u/omarithawi_elc"
    },
    "user_image_urls": {
        "full": "https://nelp-edxapp-stage.s3.eu-west-1.amazonaws.com/edx/var/edxapp/media/profile-images/065645134530d372df0384ed084648e9_500.jpg?v=1711707506",
        "large": "https://nelp-edxapp-stage.s3.eu-west-1.amazonaws.com/edx/var/edxapp/media/profile-images/065645134530d372df0384ed084648e9_120.jpg?v=1711707506",
        "medium": "https://nelp-edxapp-stage.s3.eu-west-1.amazonaws.com/edx/var/edxapp/media/profile-images/065645134530d372df0384ed084648e9_50.jpg?v=1711707506",
        "small": "https://nelp-edxapp-stage.s3.eu-west-1.amazonaws.com/edx/var/edxapp/media/profile-images/065645134530d372df0384ed084648e9_30.jpg?v=1711707506"
    }
}

We need a real backend API that shows the information above in addition to the following data:

shadinaif commented 2 months ago

we don't need this anymore, right @OmarIthawi ?

OmarIthawi commented 2 months ago

@shadinaif this is more of a cosmetic UX change to ensure the Dashboard returns a useful message instead of blank dashboard.

I think this is still needed, but we can keep it open for a while.