acl = [
{
"allow": True,
"action": "write",
"role": "ROLE_ADMIN"
},
{
"allow": True,
"action": "read",
"role": "ROLE_USER"
}
]
--
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.
def post(args, data): url = "https://" + args.serverUrl + "/api/events"
credentials = (args.username, args.password)
body = { "metadata": (None, data[0]), "acl": (None, data[1]), "processing": (None, data[2]), "scheduling": (None, data[3]) }
headers = { 'content-disposition': "form-data", 'cache-control': "no-cache", 'Connection':'close'
}
response = requests.post (url, files=body, headers=headers, auth=credentials)To unsubscribe from this group and stop receiving emails from it, send an email to us...@opencast.org.
To unsubscribe from this group and stop receiving emails from it, send an email to users+un...@opencast.org.
def get_acl(serverURL, OCUser, OCPass, seriesID): url = "https://" + serverURL + "/api/series/"+ seriesID +"/acl"
credentials = (OCUser, OCPass)
headers = { 'Authorization': "Basic", 'Accept': "*/*", 'Cache-Control': "no-cache", 'Host': serverURL, 'accept-encoding': "gzip, deflate", 'Connection':'close', 'cache-control': "no-cache" } try: response = requests.request("GET", url, headers=headers, auth=credentials) except requests.exceptions.ConnectionError as e: sys.stderr.write('Failed to establish a new connection \n') sys.stderr.write('Check the URL and connection of Opencast \n') sys.stderr.write("Exception: %s" % str(e)) sys.exit(1)
if response.status_code == 401: print ('Bad credentials: Please check the username and password')
try: return response.json() except json.decoder.JSONDecodeError as e: sys.stderr.write('Can\'t parse json output or there is no output \n') sys.stderr.write('Check that the seriesID is correct \n') sys.stderr.write("Exception: %s" % str(e)) sys.exit(1)To unsubscribe from this group and stop receiving emails from it, send an email to us...@opencast.org.
Maximiliano : Thanks for confirming that Events do not inherit their ACL from the Series, and for advice on a solution.