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

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. 


 

Solved Solved
0 2 222
1 ACCEPTED SOLUTION

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

}

View solution in original post

2 REPLIES 2

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

}

@lantrann 

This worked perfectly. Thanks for the quick response!