Commit df16cc23 authored by Roland Koller's avatar Roland Koller
Browse files

- added get_roles() function

- version bump
parent bb910bf8
......@@ -17,3 +17,29 @@ def get_organisations(client:Client, only_active:bool=True):
return { o['@Id']: o['@Name'] for o in organisations if o['@Active'] == 1 }
else:
return { o['@Id']: o['@Name'] for o in organisations }
def get_roles(client:Client, organisation_id:str):
result_get_organisations_objects = client.execute(Job(
jobname='wfm.GetOrganisationObjects',
OrganisationId=organisation_id,
RequestType=4,
ObjectIds='',
ObjectName='',
ClassIds='',
ClassName='Rolle',
AttributeId='',
AttributeValue='',
RequestData=1
))
if not result_get_organisations_objects.return_code == 0:
raise RuntimeError(result_get_organisations_objects.error_message)
roles = XmlElement.from_string(
result_get_organisations_objects.values['Objects']
).to_dict()['Object']
if not isinstance(roles, list):
roles = [ roles ]
return {r['@Id']: r['@Name'] for r in roles }
\ No newline at end of file
......@@ -5,7 +5,7 @@ with open('README.md', 'r') as fh:
setuptools.setup(
name='ecmind_blue_client_workflow',
version='0.0.1',
version='0.0.2',
author='Roland Koller',
author_email='info@ecmind.ch',
description='Helper modules for the `ecmind_blue_client` to ease the work with workflows, models and organisations.',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment