Skip to content
Snippets Groups Projects
Commit 2ad8c5f2 authored by felmer's avatar felmer
Browse files

SSDM-13135: Authorization checked. Only INSTANCE_ADMIN or SPACE_ADMIN roles...

SSDM-13135: Authorization checked. Only INSTANCE_ADMIN or SPACE_ADMIN roles can use the Dropbox Monitor
parent 91ac07a6
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
label = Dropbox MonitorAPI
class = ch.systemsx.cisd.openbis.dss.generic.server.plugins.jython.JythonIngestionService
script-path = script.py
h5-folders = ${dataset-uploader.h5-folders:false}
h5ar-folders = ${dataset-uploader.h5ar-folders:true}
from ch.systemsx.cisd.common.exceptions import UserFailureException
def process(tr, parameters, tableBuilder):
assertAuthorization(tr)
def assertAuthorization(tr):
authService = tr.getAuthorizationService()
roleAssignements = authService.listRoleAssignments()
for ra in roleAssignements:
user = ra.getUser().getUserId()
role = ra.getRoleSetCode()
if user == userId and str(role).endswith("ADMIN"):
return
raise UserFailureException("User isn't authorized for using the Dropbox Monitor.")
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