divinorum-webb / tableau-api-lib

An API library that allows developers to call on the methods listed in Tableau's REST API documentation.
MIT License
96 stars 34 forks source link

Error with add_default_permissions when RunExplainData or CreateRefreshMetrics included in capabilities #105

Open donnacoles opened 2 years ago

donnacoles commented 2 years ago

If I have a string of capabilities I want to add to the default project permissions for workbooks then this code snippet works

str2={'Read': 'Allow', 'Filter': 'Allow', 'ExportImage': 'Allow', 'ShareView': 'Allow', 'ViewUnderlyingData': 'Allow', 'WebAuthoring': 'Allow', 'Write': 'Allow', 'ExportXml': 'Allow', 'ExportData': 'Allow' }

response=conn.add_default_permissions(
project_id='6161a87d-516a-4f91-ab83-5f57e4468b63', group_id='622a76fe-2373-46ff-956e-72dfbe330bb0', project_permissions_object='workbooks', group_capability_dict=str2 )

but as soon as I add either RunExplainData or CreateRefreshMetrics to the list, so my string is like

str2={'Read': 'Allow', 'Filter': 'Allow', 'ExportImage': 'Allow', 'ShareView': 'Allow', 'ViewUnderlyingData': 'Allow', 'WebAuthoring': 'Allow', 'Write': 'Allow', 'ExportXml': 'Allow', 'ExportData': 'Allow', 'RunExplainData': 'Allow' }

the code errors with and InvalidParameterException error AddDefaultPermissionsRequest received an invalid combination of parameters. Evaluate the parameters below and correct accordingly: {'_connection': <tableau_api_lib.tableau_server_connection.TableauServerConnection object at 0x000002A1EE5DEC20>, '_request_body': {}, '_user_id': None, '_group_id': '622a76fe-2373-46ff-956e-72dfbe330bb0', '_user_capability_dict': None, '_group_capability_dict': {'Read': 'Allow', 'Filter': 'Allow', 'ExportImage': 'Allow', 'ShareView': 'Allow', 'ViewUnderlyingData': 'Allow', 'WebAuthoring': 'Allow', 'Write': 'Allow', 'ExportXml': 'Allow', 'ExportData': 'Allow', 'RunExplainData': 'Allow'}, '_user_capability_names': None, '_user_capability_modes': None, '_group_capability_names': None, '_group_capability_modes': None}

I have used the REST API directly to apply default permission with the same set of capabilities on the same server (v 2022.1) with no issue.

Can this please be looked at.