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

fix(jupyterhub): check permissions before adding environment variables #212

Merged
merged 1 commit into from
Sep 12, 2019

Conversation

lorenzo-cavazzi
Copy link
Member

Even if it's not clear why the project's environment variables were included in the spawner code, the feature seems to work according to the Manage variable permission of GitLab (https://docs.gitlab.com/ee/user/permissions.html).

Instead of removing the feature or increasing the requirement for starting JupyterLab to Maintainer level, it seems reasonable to keep this. The reference issue suggests to gracefully fail for Developer, but this PR checks instead for the permission level to decide whether to including the variables or not. It seems a reasonable solution since this appears to be a feature used by advanced users and they should be aware of the GitLab limitations implied by the member permissions.

Preview available at https://lorenzotest.dev.renku.ch

fix #210

P.S. We may also want to add a simple warning message for "non-at-least-maintainer" users in the "Notebooks Servers" tab in the UI to inform them that they may have limitations. This seems reasonable since we already discussed about relaxing the requirements to start notebooks, in which case this message would be even more useful.

@lorenzo-cavazzi lorenzo-cavazzi requested a review from a team as a code owner September 12, 2019 14:13
variable.key: variable.value for variable in gl_project.variables.list()
}
self.environment.update(environment)
if access_level >= gitlab.MAINTAINER_ACCESS:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think only God is above Maintainer :) Or maybe the admin.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ahah right. I remember I have seen something above Maintainer, but it seems to be only for groups https://docs.gitlab.com/ee/api/access_requests.html

Copy link
Member

@rokroskar rokroskar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, thanks!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

notebook spawn requires maintainer permissions
2 participants