Solved

API 4.0 Update Content Metadata "inherits" : "false"

  • 18 March 2022
  • 2 replies
  • 59 views

I’m using the Python SDK with 4.0 API to give one group permission to a newly created folder. By default, folders inherit the access permissions of the parent folder and want to use the SDK to make this folder not inherit these permissions. This is the code I’m using:

 

sdk.update_content_metadata(812, body = {"inherits" : "false"})

Where 812 is the content metadata id. 

This runs fine but the output shows that “inherits” is still “True”. Has anyone had similar issues? Thanks. 

 


 

icon

Best answer by Lan 24 March 2022, 08:59

View original

This topic has been closed for comments

2 replies

Userlevel 4

Hi @ryangifford

According to doc, inherits is a boolean, so perhaps you could try the following syntax: 

response = sdk.update_content_metadata(
body=models.WriteContentMeta(
inherits=False
))

 

ContentMeta {

can (object, read-only): Operations the current user is able to perform on this object,

id (long, read-only): Unique Id,

name (string, read-only): Name or title of underlying content,

parent_id (long, read-only): Id of Parent Content,

dashboard_id (string, read-only): Id of associated dashboard when content_type is "dashboard",

look_id (string, read-only): Id of associated look when content_type is "look",

folder_id (string, read-only): Id of associated folder when content_type is "space",

content_type (string, read-only): Content Type ("dashboard", "look", or "folder"),

inherits (boolean): Whether content inherits its access levels from parent,

inheriting_id (long, read-only): Id of Inherited Content,

slug (string, read-only): Content Slug

}

@Lan 

This worked perfectly. Thanks for the quick response!