Skip to content
Snippets Groups Projects
Commit 66ed09b0 authored by Megan Henning's avatar Megan Henning
Browse files

Add swagger

parent 9eec5f52
No related branches found
No related tags found
No related merge requests found
......@@ -47,9 +47,8 @@ def files_sublist(handler, container):
def g(exec_op):
def f(method, _id, query_params=None, payload=None, exclude_params=None):
errors = None
if method == 'GET' and container.get('public', False):
min_access = -1
elif method == 'GET':
min_access = sys.maxint
if method == 'GET':
min_access = INTEGER_PERMISSIONS['ro']
elif method in ['POST', 'PUT']:
min_access = INTEGER_PERMISSIONS['rw']
......@@ -66,10 +65,6 @@ def files_sublist(handler, container):
else:
errors = {'reason': 'permission_denied'}
else:
min_access = sys.maxint
log.warning('the user access is {} and the min access is {}'.format(access, min_access))
if access >= min_access:
return exec_op(method, _id, query_params, payload, exclude_params)
......
......@@ -14,6 +14,8 @@ $template_arguments:
arguments:
update-input-schema: schemas/input/acquisition-update.json
get-output-schema: schemas/output/acquisition.json
delete-description: Read-write project permissions are required to delete an acquisition. </br>Admin project permissions are required if the acquisition contains data uploaded by sources other than users and jobs.
# ===== Tags =====
/acquisitions/{AcquisitionId}/tags:
......
......@@ -14,6 +14,7 @@ $template_arguments:
arguments:
update-input-schema: schemas/input/project-update.json
get-output-schema: schemas/output/project.json
delete-description: Only site admins and users with "admin" project permissions may delete a project
/projects/groups:
get:
......@@ -112,8 +113,8 @@ $template_arguments:
- in: body
name: body
schema:
$ref: schemas/input/rule-update.json
$ref: schemas/input/rule-update.json
'/projects/{ProjectId}/template':
parameters:
......
......@@ -14,8 +14,9 @@ $template_arguments:
arguments:
update-input-schema: schemas/input/session.json
get-output-schema: schemas/output/session.json
delete-description: Read-write project permissions are required to delete a session. </br>Admin project permissions are required if the session or it's acquisitions contain data uploaded by sources other than users and jobs.
'/sessions/{SessionId}/jobs':
/sessions/{SessionId}/jobs:
parameters:
- in: path
type: string
......@@ -104,7 +105,7 @@ $template_arguments:
parameters:
- in: body
name: body
schema:
schema:
$ref: schemas/input/analysis-job.json
- in: query
type: boolean
......
......@@ -9,6 +9,8 @@ parameters:
type: string
- name: get-output-schema
type: string
- name: delete-description
type: string
template: |
parameters:
- in: path
......@@ -43,6 +45,9 @@ template: |
delete:
summary: Delete a {{resource}}
operationId: delete_{{resource}}
{{#delete-description}}
description: {{{.}}}
{{/delete-description}}
tags:
- '{{tag}}'
responses:
......
......@@ -35,7 +35,7 @@ template: |
- name: ticket
in: query
type: string
description: The generated ticket id for the download, or present but empty to generate a ticket id.
description: The generated ticket id for the download, or present but empty to generate a ticket id
- name: view
in: query
type: boolean
......@@ -69,4 +69,18 @@ template: |
responses:
default:
description: ''
delete:
summary: Delete a file
description: |
A user with read-write or higher permissions on the container may delete files
that were uploaded by users or were the output of jobs. (Specifically, files
whose `origin.type` is either `job` or `user`.)
<br/>
A user with admin permissions on the container may delete any file.
operationId: delete_{{resource}}_file
tags:
- '{{tag}}'
responses:
'200':
$ref: '#/responses/200:deleted-with-count'
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment