To start building up a query specifically for personas, you can use the select() convenience method on Persona itself. Because this operation may need to retrieve information from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
The search will only run when you call the stream() method, which will then lazily-load each page of results into a stream.
(Optional) You can do any other operations you might do on a stream, such as filtering the results to ensure they are of a certain type.
This is the pattern for iterating through all results (across pages) covered in the Searching for assets portion of the SDK documentation.
List personas
1 2 3 4 5 6 7 8 91011121314
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportPersonafrompyatlan.model.fluent_searchimportCompoundQuery,FluentSearchclient=AtlanClient()search_request=(FluentSearch()# (1).where(CompoundQuery.active_assets()).where(CompoundQuery.asset_type(Persona))# (2)).to_request()# (3)results=client.asset.search(search_request)# (4)forassetinresults:# (5)ifisinstance(asset,Persona):# Do something with the Persona
Begin building up a query combining multiple conditions.
Ensure that we include only objects of type Persona.
Build this query into a new search request.
Run the search.
Page through the results (each asset in the results will be a persona).
To start building up a query specifically for personas, you can use the select() convenience method on Persona itself. Because this operation may need to retrieve information from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
The search will only run when you call the stream() method, which will then lazily-load each page of results into a stream.
(Optional) You can do any other operations you might do on a stream, such as filtering the results to ensure they are of a certain type.
This is the pattern for iterating through all results (across pages) covered in the Searching for assets portion of the SDK documentation.
List personas
1 2 3 4 5 6 7 8 910111213
response,atlanErr:=assets.NewFluentSearch().// (1)PageSizes(20).ActiveAssets().AssetType("Persona").// (2)Execute()// (3)ifatlanErr!=nil{fmt.Println("Error:",atlanErr)}for_,entity:=rangeresponse[0].Entities{// (4)ifentity.TypeName!=nil&&*entity.TypeName=="Persona"{// Do something with the Persona}}
Begin building up a query combining multiple conditions.
Ensure that we include only objects of type Persona.
Run the search.
Page through the results (each asset in the results will be a persona).
Like other builder patterns in the SDK, the creator() method ensures all required information is provided for the persona.
To create the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You can then retrieve the resulting details of the created persona from the response (you may of course want to do some type checking first).
Like other builder patterns in the SDK, the creator() method ensures all required information is provided for the persona.
To create the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You can then retrieve the resulting details of the created persona from the response (you may of course want to do some type checking first).
Create a persona
1 2 3 4 5 6 7 8 91011
toCreate:=&assets.Persona{}toCreate.Creator("Data Assets")// (1)response,atlanErr:=assets.Save(toCreate)// (2)ifatlanErr!=nil{fmt.Println("Error:",atlanErr)}else{for_,entity:=rangeresponse.MutatedEntities.CREATE{// (3)fmt.Println("Persona ID:",entity.Guid,"Display Text:",entity.DisplayText)// Do something with the Persona}}
Like other builder patterns in the SDK, the Creator() method ensures all required information is provided for the persona.
To create the persona in Atlan, call the Save() method against the object you've built.
You can then retrieve the resulting details of the created persona from the response (you may of course want to do some type checking first).
The findByName() method handles searching for the persona based on its name, which could therefore return more than one result. You can also (optionally) provide a second parameter with a list of attributes to retrieve for each persona. Because this operation will retrieve information from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
The findByName() method handles searching for the persona based on its name, which could therefore return more than one result. You can also (optionally) provide a second parameter with a list of attributes to retrieve for each persona. Because this operation will retrieve information from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
PersonatoUpdate=Persona.updater(// (1)"default/M5HnBQ8QWhrAVGuvBx8iSW",// (2)"Data Assets",// (3)true)// (4).description("Now with a description!")// (5).build();AssetMutationResponseresponse=toUpdate.save(client);// (6)
Use the updater() method to update a persona.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then chain on any other updates, such as changing the description of the persona.
To update the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Update a persona
1 2 3 4 5 6 7 8 91011
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportPersonaclient=AtlanClient()to_update=Persona.updater(# (1)"default/M5HnBQ8QWhrAVGuvBx8iSW",# (2)"Data Assets",# (3)True# (4))to_update.description="Now with a description!"# (5)response=client.asset.save(to_update)# (7)
Use the updater() method to update a persona.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then add on any other updates, such as changing the description of the persona.
To update the persona in Atlan, call the save() method with the object you've built.
Update a persona
1234567
valtoUpdate=Persona.updater(// (1)"default/M5HnBQ8QWhrAVGuvBx8iSW",// (2)"Data Assets",// (3)true)// (4).description("Now with a description!")// (5).build()valresponse=toUpdate.save(client)// (6)
Use the updater() method to update a persona.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then chain on any other updates, such as changing the description of the persona.
To update the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Update a persona
123456789
toUpdate:=&assets.Persona{}toUpdate.Updater(// (1)"default/M5HnBQ8QWhrAVGuvBx8iSW",// (2)"Data Assets",// (3)true,// (4))description:="Now with a description "toUpdate.Description=&description// (5)response,atlanErr:=assets.Save(toUpdate)// (6)
Use the updater() method to update a persona.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then add on any other updates, such as changing the description of the persona.
To update the persona in Atlan, call the Save() method with the object you've built.
POST /api/meta/entity/bulk
1 2 3 4 5 6 7 8 910111213
{"entities":[// (1){"typeName":"Persona",// (2)"attributes":{"qualifiedName":"default/M5HnBQ8QWhrAVGuvBx8iSW",// (3)"name":"Data Assets"// (4)"isAccessControlEnabled":true,// (5)"description":"Now with a description!",// (6)}}]}
Wrap all updates in an entities array.
For each embedded object, use the exact type name Persona.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then add on any other updates, such as changing the description of the persona.
To permanently delete a persona in Atlan, call the purge() method with the GUID of the persona. Because this operation will remove the structure from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
To permanently delete a persona in Atlan, call the purge() method with the GUID of the persona. Because this operation will remove the structure from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update. Setting this to false will deactivate the persona, while setting it to true will activate the persona.
To then apply that activation / deactivation to the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the state in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You must provide the qualified_name of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update. Setting this to False will deactivate the persona, while setting it to True will activate the persona.
To then apply that activation / deactivation to the persona in Atlan, call the save() method with the object you've built.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update. Setting this to false will deactivate the persona, while setting it to true will activate the persona.
To then apply that activation / deactivation to the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the state in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update. Setting this to False will deactivate the persona, while setting it to True will activate the persona.
To then apply that activation / deactivation to the persona in Atlan, call the Save() method with the object you've built.
For each embedded object, use the exact type name Persona.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update. Setting this to false will deactivate the persona, while setting it to true will activate the persona.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then chain any number of updates to the personaGroup() property. These should be internal names of groups that you want to be controlled through the persona's policies.
Similarly, you can chain any number of updates to the personaUser() property. These should be usernames of users that you want to be controlled through the persona's policies.
To then apply those membership updates to the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then add any number of groups to the persona_groups property. These should be internal names of groups that you want to be controlled through the persona's policies.
Similarly, you can add any number of users to the persona_users property. These should be usernames of users that you want to be controlled through the persona's policies.
To then apply those membership updates to the persona in Atlan, call the save() method against the object you've built.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then chain any number of updates to the personaGroup() property. These should be internal names of groups that you want to be controlled through the persona's policies.
Similarly, you can chain any number of updates to the personaUser() property. These should be usernames of users that you want to be controlled through the persona's policies.
To then apply those membership updates to the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then add any number of groups to the PersonaGroups property. These should be internal names of groups that you want to be controlled through the persona's policies.
Similarly, you can add any number of users to the PersonaUsers property. These should be usernames of users that you want to be controlled through the persona's policies.
To then apply those membership updates to the persona in Atlan, call the Save() method against the object you've built.
For each embedded object, use the exact type name Persona.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then add any number of groups to the personaGroups property. These should be internal names of groups that you want to be controlled through the persona's policies.
Similarly, you can add any number of users to the personaUsers property. These should be usernames of users that you want to be controlled through the persona's policies.
Be careful to only add policies one-by-one to a persona. While the SDKs will allow you to add them in bulk, currently this results in a persona where only the final policy in the batch is active at the end of the operation.
API token must be a connection admin
To manage policies for a connection, the API token must be a connection admin on that connection. When you create a connection using an API token, the API token is automatically made a connection admin; however, for any other connection you must carry out extra steps to make the API token a connection admin.
Use the createMetadataPolicy() method to start building a metadata policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying the actions specified next).
Specify the set of permissions you want to allow (or deny) in this policy.
To include all permissions
If you want to include all permissions, you can simply use Arrays.asList(PersonaMetadataAction.values()).
Specify the qualifiedName of the connection whose assets this policy should control.
Specify the set of qualifiedName prefixes for the assets this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualifiedName of the connection itself.
To then add the policy to the persona in Atlan, call the save() method against the policy object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Use the create_metadata_policy() method to start building a metadata policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying the actions specified next).
Specify the set of permissions you want to allow (or deny) in this policy.
Specify the qualified_name of the connection whose assets this policy should control.
Specify the set of qualified_name prefixes for the assets this policy should control. Each qualified_name should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualified_name of the connection itself.
To then add the policy to the persona in Atlan, call the save() method with the policy object you've built.
Use the createMetadataPolicy() method to start building a metadata policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying the actions specified next).
Specify the set of permissions you want to allow (or deny) in this policy.
To include all permissions
If you want to include all permissions, you can simply use PersonaMetadataAction.values().toList().
Specify the qualifiedName of the connection whose assets this policy should control.
Specify the set of qualifiedName prefixes for the assets this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualifiedName of the connection itself.
To then add the policy to the persona in Atlan, call the save() method against the policy object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Use the CreateMetadataPolicy() method to start building a metadata policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying the actions specified next).
Specify the set of permissions you want to allow (or deny) in this policy.
Specify the qualifiedName of the connection whose assets this policy should control.
Specify the set of qualifiedName prefixes for the assets this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualifiedName of the connection itself.
To then add the policy to the persona in Atlan, call the save() method with the policy object you've built.
For each embedded object, use the exact type name AuthPolicy.
You must use a policy subcategory of metadata.
You must use a policy category of persona.
Specify the type of policy (granting or denying the actions specified next).
You must use a policy service name of atlas.
Specify the qualifiedName of the connection whose assets will be controlled by this policy.
Specify the set of qualifiedName prefixes for the assets this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualifiedName of the connection itself.
You must give the policy a name.
You must give the policy itself a qualifiedName, although this will be overwritten by a generated value by the back-end.
Specify the set of permissions you want to allow (or deny) in this policy.
To review available permissions
To review the available permissions, see the SDKs — for example, the PersonaMetadataAction enum in the Java SDK.
Use an embedded accessControl object to define the persona to attach this policy to.
The embedded type name of the accessControl object must be exactly Persona.
You must provide the GUID of the persona to attach this policy to.
You must set the policy resource category to CUSTOM.
Use the createDataPolicy() method to start building a data policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying access to the data of the resources specified next).
Specify the qualifiedName of the connection whose assets this policy should control.
Specify the set of qualifiedName prefixes for the assets this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualifiedName of the connection itself.
To then add the policy to the persona in Atlan, call the save() method against the policy object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Use the create_data_policy() method to start building a data policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying access to the data of the resources specified next).
Specify the qualifiedName of the connection whose assets this policy should control.
Specify the set of qualified_name prefixes for the assets this policy should control. Each qualified_name should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualified_name of the connection itself.
To then add the policy to the persona in Atlan, call the save() method with the policy object you've built.
Use the createDataPolicy() method to start building a data policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying access to the data of the resources specified next).
Specify the qualifiedName of the connection whose assets this policy should control.
Specify the set of qualifiedName prefixes for the assets this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualifiedName of the connection itself.
To then add the policy to the persona in Atlan, call the save() method against the policy object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Use the CreateDataPolicy() method to start building a data policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying access to the data of the resources specified next).
Specify the qualifiedName of the connection whose assets this policy should control.
Specify the set of qualifiedName prefixes for the assets this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualifiedName of the connection itself.
To then add the policy to the persona in Atlan, call the Save() method with the policy object you've built.
For each embedded object, use the exact type name AuthPolicy.
You must use a policy subcategory of data.
You must use a policy category of persona.
Specify the type of policy (granting or denying the actions specified next).
You must use a policy service name of heka.
Specify the qualifiedName of the connection whose assets will be controlled by this policy.
You must include a resource of entity-type:* in the list of resources.
Specify the set of qualifiedName prefixes for the assets this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all assets within a connection, this can simply be the qualifiedName of the connection itself.
You must give the policy a name.
You must give the policy itself a qualifiedName, although this will be overwritten by a generated value by the back-end.
Specify the set of permissions you want to allow (or deny) in this policy. A data policy for a persona can only allow or deny select permissions.
Use an embedded accessControl object to define the persona to attach this policy to.
The embedded type name of the accessControl object must be exactly Persona.
You must provide the GUID of the persona to attach this policy to.
You must set the policy resource category to ENTITY.
Use the createGlossaryPolicy() method to start building a glossary policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying the actions specified next).
Specify the set of permissions you want to allow (or deny) in this policy.
To include all permissions
If you want to include all permissions, you can simply use Arrays.asList(PersonaGlossaryAction.values()).
Specify the set of qualifiedNames of glossaries this policy should control. Each qualifiedName should itself be prefixed with entity:.
To then add the policy to the persona in Atlan, call the save() method against the policy object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Use the createGlossaryPolicy() method to start building a glossary policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the type of policy (granting or denying the actions specified next).
Specify the set of permissions you want to allow (or deny) in this policy.
To include all permissions
If you want to include all permissions, you can simply use PersonaGlossaryAction.values().toList().
Specify the set of qualifiedNames of glossaries this policy should control. Each qualifiedName should itself be prefixed with entity:.
To then add the policy to the persona in Atlan, call the save() method against the policy object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
AuthPolicydomain=Persona.createDomainPolicy(// (1)"Read access to some domains",// (2)"67e08ab7-9688-40bc-ae4a-da2bc06b1588",// (3)Set.of(PersonaDomainAction.READ_DOMAIN,PersonaDomainAction.READ_SUBDOMAIN,PersonaDomainAction.READ_PRODUCTS),// (4)Set.of("entity:default/domain/marketing","entity:default/domain/finance"))// (5).build();AssetMutationResponseresponse=domain.save(client);// (6)
Use the createDomainPolicy() method to start building a domain policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the set of permissions you want to allow in this policy.
To include all permissions
If you want to include all permissions, you can simply use Arrays.asList(PersonaDomainAction.values()).
Specify the set of qualifiedNames for the domains this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all domains, this can simply be a single value of entity:All domains.
To then add the policy to the persona in Atlan, call the save() method against the policy object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Add domain policy to persona
1 2 3 4 5 6 7 8 9101112
frompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportPersonafrompyatlan.model.enumsimportAuthPolicyType,PersonaDomainActionclient=AtlanClient()domain=Persona.create_domain_policy(# (1)name="Read access to some domains",# (2)persona_id="67e08ab7-9688-40bc-ae4a-da2bc06b1588",# (3)actions={PersonaDomainAction.READ_DOMAIN,PersonaDomainAction.READ_SUBDOMAIN,PersonaDomainAction.READ_PRODUCTS},# (4)resources={"entity:default/domain/marketing","entity:default/domain/finance"},# (5))response=client.asset.save(domain)# (6)
Use the create_domain_policy() method to start building a domain policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the set of permissions you want to allow in this policy.
Specify the set of qualified_names for the domains this policy should control. Each qualified_name should itself be prefixed with entity:. To control all domains, this can simply be a single value of entity:All domains.
To then add the policy to the persona in Atlan, call the save() method with the policy object you've built.
Add domain policy to persona
1234567
valdomain=Persona.createDomainPolicy(// (1)"Read access to some domains",// (2)"67e08ab7-9688-40bc-ae4a-da2bc06b1588",// (3)setOf(PersonaDomainAction.READ_DOMAIN,PersonaDomainAction.READ_SUBDOMAIN,PersonaDomainAction.READ_PRODUCTS),// (4)setOf("entity:default/domain/marketing","entity:default/domain/finance"))// (5).build()valresponse=domain.save(client)// (6)
Use the createDomainPolicy() method to start building a domain policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the set of permissions you want to allow in this policy.
To include all permissions
If you want to include all permissions, you can simply use PersonaDomainAction.values().toList().
Specify the set of qualifiedNames for the domains this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all domains, this can simply be a single value of entity:All domains.
To then add the policy to the persona in Atlan, call the save() method against the policy object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
Add domain policy to persona
12345678
Persona:=&assets.Persona{}domain,_:=Persona.CreateDomainPolicy(// (1)"Allow access to domain",// (2)"67e08ab7-9688-40bc-ae4a-da2bc06b1588",// (3)[]atlan.PersonaDomainAction{atlan.PersonaDomainActionRead,atlan.PersonaDomainActionReadSubdomain,atlan.PersonaDomainActionReadProducts},// (4)[]string{"entity:default/domain/marketing","entity:default/domain/finance"},// (5))response,err:=assets.Save(domain)// (6)
Use the CreateDomainPolicy() method to start building a domain policy with the minimal required information.
You must give the policy a name.
You must provide the GUID of the persona to attach this policy to.
Specify the set of permissions you want to allow in this policy.
Specify the set of qualifiedNames for the domains this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all domains, this can simply be a single value of entity:All domains.
To then add the policy to the persona in Atlan, call the Save() method with the policy object you've built.
{"entities":[// (1){"typeName":"AuthPolicy",// (2)"attributes":{"policySubCategory":"domain",// (3)"policyCategory":"persona",// (4)"policyType":"allow",// (5)"policyServiceName":"atlas",// (6)"policyResources":["entity:default/domain/marketing",// (7)"entity:default/domain/finance"],"name":"Read access to some domains",// (8)"qualifiedName":"Read access to some domains",// (9)"policyActions":["persona-domain-read",// (10)"persona-domain-sub-domain-read","persona-domain-product-read"],"accessControl":{// (11)"typeName":"Persona",// (12)"guid":"67e08ab7-9688-40bc-ae4a-da2bc06b1588"// (13)},"policyResourceCategory":"CUSTOM"// (14)}}]}
Wrap all updates in an entities array.
For each embedded object, use the exact type name AuthPolicy.
You must use a policy subcategory of domain.
You must use a policy category of persona.
The type of policy should always be allow.
You must use a policy service name of atlas.
Specify the set of qualifiedNames for the domains this policy should control. Each qualifiedName should itself be prefixed with entity:. To control all domains, this can simply be a single value of entity:All domains.
You must give the policy a name.
You must give the policy itself a qualifiedName, although this will be overwritten by a generated value by the back-end.
Specify the set of permissions you want to allow in this policy.
To review available permissions
To review the available permissions, see the SDKs — for example, the PersonaDomainAction enum in the Java SDK.
Use an embedded accessControl object to define the persona to attach this policy to.
The embedded type name of the accessControl object must be exactly Persona.
You must provide the GUID of the persona to attach this policy to.
You must set the policy resource category to CUSTOM.
Persona.select(client)// (1).where(Persona.NAME.eq("Data Assets"))// (2).includeOnResults(Persona.POLICIES)// (3).includeOnRelations(AuthPolicy.NAME)// (4).includeOnRelations(AuthPolicy.POLICY_TYPE).includeOnRelations(AuthPolicy.POLICY_RESOURCES).includeOnRelations(AuthPolicy.POLICY_ACTIONS).stream()// (5).filter(a->ainstanceofPersona).forEach(p->{// (6)Set<IAuthPolicy>policies=((Persona)p).getPolicies();for(IAuthPolicypolicy:policies){// Do something with each policy}});
Start by selecting a persona, here using a FluentSearch-based approach. Because this operation will retrieve information from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You can select the persona by whatever you like, in this example we are selecting based on its name.
Include the policies for the persona as part of the search results.
Include all the attributes you want about each policy on the relations of the search results. Here we are including the name, type, actions and resources controlled by each policy.
You can then directly stream the results of the search.
For each result of the search (itself a Persona), you can then retrieve its policies and iterate through them.
List all policies in a persona
1 2 3 4 5 6 7 8 910111213141516171819202122
fromtypingimportcastfrompyatlan.client.atlanimportAtlanClientfrompyatlan.model.assetsimportPersona,AuthPolicyfrompyatlan.model.fluent_searchimportFluentSearchclient=AtlanClient()request=(FluentSearch().where(FluentSearch.asset_type(Persona))# (1).where(Persona.NAME.eq("Data Assets"))# (2).include_on_results(Persona.POLICIES)# (3).include_on_relations(AuthPolicy.NAME)# (4).include_on_relations(AuthPolicy.POLICY_TYPE).include_on_relations(AuthPolicy.POLICY_RESOURCES).include_on_relations(AuthPolicy.POLICY_ACTIONS)).to_request()# (5)response=client.asset.search(request)# (6)forpinresponse:# (7)policies=cast(Persona,p).policiesforpolicyinpolicies:# Do something with each policy
Start by selecting a persona, here using a FluentSearch-based approach.
You can select the persona by whatever you like, in this example we are selecting based on its name.
Include the policies for the persona as part of the search results.
Include all the attributes you want about each policy on the relations of the search results. Here we are including the name, type, actions and resources controlled by each policy.
You can then translate the FluentSearch into a search request.
Run a search using the search request.
For each result of the search (itself a Persona), you can then retrieve its policies and iterate through them.
List all policies in a persona
1 2 3 4 5 6 7 8 9101112131415
Persona.select(client)// (1).where(Persona.NAME.eq("Data Assets"))// (2).includeOnResults(Persona.POLICIES)// (3).includeOnRelations(AuthPolicy.NAME)// (4).includeOnRelations(AuthPolicy.POLICY_TYPE).includeOnRelations(AuthPolicy.POLICY_RESOURCES).includeOnRelations(AuthPolicy.POLICY_ACTIONS).stream()// (5).filter{itisPersona}.forEach{// (6)valpolicies=(itasPersona).policiesfor(policyinpolicies){// Do something with each policy}}
Start by selecting a persona, here using a FluentSearch-based approach. Because this operation will retrieve information from Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You can select the persona by whatever you like, in this example we are selecting based on its name.
Include the policies for the persona as part of the search results.
Include all the attributes you want about each policy on the relations of the search results. Here we are including the name, type, actions and resources controlled by each policy.
You can then directly stream the results of the search.
For each result of the search (itself a Persona), you can then retrieve its policies and iterate through them.
List all policies in a persona
1 2 3 4 5 6 7 8 910111213141516171819202122
response,atlanErr:=assets.NewFluentSearch().PageSizes(20).AssetType("Persona").// (1)Where(ctx.Persona.NAME.Eq("Data Assets")).// (2)IncludeOnResults("policies").// (3)IncludeOnRelations("name").// (4)IncludeOnRelations("policyActions").IncludeOnRelations("policyResources").IncludeOnRelations("policyType").Execute()// (5)ifatlanErr!=nil{fmt.Println("Error:",atlanErr)}for_,entity:=rangeresponse[0].Entities{// (6)ifentity.TypeName!=nil&&*entity.TypeName=="Persona"{fmt.Println("Persona Found: Name:",*entity.Name,"QualifiedName:",*entity.QualifiedName)for_,policy:=range*entity.Policies{fmt.Println("Policy Found: QualifiedName:",*policy.UniqueAttributes.QualifiedName)// Do something with the policies}}}
Start by selecting a persona, here using a FluentSearch-based approach.
You can select the persona by whatever you like, in this example we are selecting based on its name.
Include the policies for the persona as part of the search results.
Include all the attributes you want about each policy on the relations of the search results. Here we are including the name, type, actions and resources controlled by each policy.
Run a fluent search request using the Execute().
For each result of the search (itself a Persona), you can then retrieve its policies and iterate through them.
You can select the persona by whatever you like, in this example we are selecting based on its name.
Include the policies for the persona as part of the search results.
Include all the attributes you want about each policy on the relations of the search results. Here we are including the name, type, actions and resources controlled by each policy.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then chain preferences on which metadata tabs should be hidden when using this persona.
You can then set preferences on which asset types should be hidden when using this persona.
You can then set preferences on which asset filters should be hidden when using this persona.
You can then set preferences on which custom metadata should be hidden when using this persona.
To update the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.
You must provide the qualifiedName of the persona.
You must provide the name of the persona.
You must provide whether the persona should be active (enabled) or deactivated after the update.
You can then chain preferences on which metadata tabs should be hidden when using this persona.
You can then set preferences on which asset types should be hidden when using this persona.
You can then set preferences on which asset filters should be hidden when using this persona.
You can then set preferences on which custom metadata should be hidden when using this persona.
To update the persona in Atlan, call the save() method against the object you've built. Because this operation will persist the structure in Atlan, you must provide it an AtlanClient through which to connect to the tenant.