Skip to content

Commit

Permalink
Allow a non-admin user to create a settings file with a user context
Browse files Browse the repository at this point in the history
  • Loading branch information
manthey committed Sep 25, 2024
1 parent 3bac9b6 commit f2facdb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion girder/girder_large_image/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ def yamlConfigFileWrite(folder, name, user, yaml_config, user_context):
:param user_context: whether these settings should only apply to the current user.
"""
yaml_parsed = yaml.safe_load(yaml_config)
item = Item().createItem(name, user, folder, reuseExisting=True)
item = Item().createItem(name, user, folder, reuseExisting=True, force=bool(user_context))
existingFiles = list(Item().childFiles(item))
if (len(existingFiles) == 1 and
existingFiles[0]['mimeType'] == 'application/yaml' and
Expand Down
3 changes: 2 additions & 1 deletion girder/girder_large_image/rest/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ def getYAMLConfigFile(self, folder, name):
'file may be permanently deleted.')
.modelParam('id', model=Folder, level=AccessType.WRITE)
.param('name', 'The name of the file.', paramType='path')
.param('user_context', 'Whether these settings should only apply to the current user.', paramType='query', dataType='boolean', default=False)
.param('user_context', 'Whether these settings should only apply to the '
'current user.', paramType='query', dataType='boolean', default=False)
.param('config', 'The contents of yaml config file to validate.',
paramType='body'),
)
Expand Down

0 comments on commit f2facdb

Please sign in to comment.