Skip to content

Commit

Permalink
admin structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
mpilosov committed Feb 19, 2019
1 parent 5ca00bd commit b82f309
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,23 +33,23 @@ class MyDockerSpawner(DockerSpawner):

for i in range(1,len(parts)):
group_id = parts.pop()
if group_id != 'admin': # no need for an admin group.
group_map[user_name].append(group_id)
group_map[user_name].append(group_id)
def start(self):
if self.user.name in self.group_map:
group_list = self.group_map[self.user.name]
# add team volume to volumes
for group_id in group_list: # one superuser gets upload rights.
if self.user.name == 'hub-admin':
self.volumes['shared-{}'.format(group_id)] = {
'bind': '/home/jovyan/%s'%(group_id),
'mode': 'rw', # or ro for read-only
}
else: # this "shared-" is part of the naming convention
self.volumes['shared-{}'.format(group_id)] = {
'bind': '/home/jovyan/%s'%(group_id),
'mode': 'ro',
}
if group_id != 'admin':
if 'admin' in group_list:
self.volumes['shared-{}'.format(group_id)] = {
'bind': '/home/jovyan/%s'%(group_id),
'mode': 'rw', # or ro for read-only
}
else: # this "shared-" is part of the naming convention
self.volumes['shared-{}'.format(group_id)] = {
'bind': '/home/jovyan/%s'%(group_id),
'mode': 'ro',
}
if self.user.name == 'hub-admin': # if admin, allow userlist access
self.volumes['%s/userlist'%(os.environ['HUB_LOC'])] = { 'bind': '/home/jovyan/userlist',
'mode': 'rw' }
Expand Down

0 comments on commit b82f309

Please sign in to comment.