Personas
Personas are a way of curating assets for a group of users.
List personas
To retrieve a listing of personas, run a search and page the results:
- Java
- Python
- Kotlin
- Go
- Raw REST API
Persona.select(client) // (1)
.stream() // (2)
.filter(a -> a instanceof Persona) // (3)
.forEach(p -> { // (4)
log.info("Persona: {}", p);
});
- To start building up a query specifically for personas, you can use the
select()convenience method onPersonaitself. Because this operation may need to retrieve information from Atlan, you must provide it anAtlanClientthrough 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 make sure they're 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.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
from pyatlan.model.fluent_search import CompoundQuery, FluentSearch
client = 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)
for asset in results: # (5)
if isinstance(asset, Persona):
# Do something with the Persona
- Begin building up a query combining multiple conditions.
- Make sure 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).
Persona.select(client) // (1)
.stream() // (2)
.filter { it is Persona } // (3)
.forEach { // (4)
log.info { "Persona: $it" }
}
- To start building up a query specifically for personas, you can use the
select()convenience method onPersonaitself. Because this operation may need to retrieve information from Atlan, you must provide it anAtlanClientthrough 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 make sure they're 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.
response, atlanErr := assets.NewFluentSearch(). // (1)
PageSizes(20).
ActiveAssets().
AssetType("Persona"). // (2)
Execute() // (3)
if atlanErr != nil {
fmt.Println("Error:", atlanErr)
}
for _, entity := range response[0].Entities { // (4)
if entity.TypeName != nil && *entity.TypeName == "Persona" {
// Do something with the Persona
}
}
- Begin building up a query combining multiple conditions.
- Make sure that we include only objects of type
Persona. - Run the search.
- Page through the results (each asset in the results will be a persona).
{
"dsl": {
"query": { // (1)
"bool": {
"filter": [
{
"term": {
"__state": {
"value": "ACTIVE"
}
}
},
{
"term": {
"__typeName.keyword": {
"value": "Persona" // (2)
}
}
}
]
}
},
"track_total_hits": true
},
"suppressLogs": true,
"showSearchScore": false,
"excludeMeanings": false,
"excludeClassifications": false
}
- Begin building up a query combining multiple conditions.
- Make sure that we include only objects of type
Persona.
Create persona
To create a new persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
Persona toCreate = Persona.creator("Data Assets").build(); // (1)
AssetMutationResponse response = toCreate.save(client); // (2)
Persona persona = (Persona) response.getCreatedAssets().get(0); // (3)
- 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 anAtlanClientthrough 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).
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
client = AtlanClient()
to_create = Persona.creator(name="Data Assets") # (1)
response = client.asset.save(to_create) # (2)
p = response.assets_created(asset_type=Persona)[0] # (3)
- Like other builder patterns in the SDK, the
create()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).
val toCreate = Persona.creator("Data Assets").build() // (1)
val response = toCreate.save(client) // (2)
val persona = response.createdAssets[0] as Persona // (3)
- 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 anAtlanClientthrough 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).
toCreate := &assets.Persona{}
toCreate.Creator("Data Assets") // (1)
response, atlanErr := assets.Save(toCreate) // (2)
if atlanErr != nil {
fmt.Println("Error:", atlanErr)
} else {
for _, entity := range response.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).
{
"entities": [ // (1)
}
]
}
- Wrap the persona definition in an
entitiesarray. - Make sure the type of each nested object is exactly
Persona. - Use the
displayNameto provide the name for the persona as you want it to appear in the UI. - Make sure you explicitly set the access control to enabled when creating it.
- You must provide a
qualifiedNamefor the persona, although this will be generated and overwritten by the back-end - You must provide a
namefor the persona, although this will also be normalized by the back-end so will be slightly different once created.
Retrieve persona
To retrieve a persona by its name:
- Java
- Python
- Kotlin
- Go
- Raw REST API
List<Persona> list = Persona.findByName(client, "Data Assets"); // (1)
- 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 anAtlanClientthrough which to connect to the tenant.
from pyatlan.client.atlan import AtlanClient
client = AtlanClient()
result = client.asset.find_personas_by_name("Data Assets") # (1)
- The
asset.find_personas_by_name()method handles searching for the persona based on its name, which could therefore return more than one result.
val list = Persona.findByName(client, "Data Assets") // (1)
- 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 anAtlanClientthrough which to connect to the tenant.
response, atlanErr := assets.FindPersonasByName("Data Assets") // (1)
- The
assets.FindPersonasByName()method handles searching for the persona based on its name, which could therefore return more than one result.
{
"dsl": {
"query": {
"bool": {
"filter": [
{
"term": {
"__state": {
"value": "ACTIVE"
}
}
},
{
"term": {
"__typeName.keyword": {
"value": "Persona" // (1)
}
}
},
{
"term": {
"name.keyword": {
"value": "Data Assets" // (2)
}
}
}
]
}
},
"track_total_hits": true
},
"suppressLogs": true,
"showSearchScore": false,
"excludeMeanings": false,
"excludeClassifications": false
}
- Define the search to include results for a type exactly matching
Persona, and... - ... with the exact name of the persona you want to find.
Update persona
To update a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
Persona toUpdate = Persona.updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
true) // (4)
.description("Now with a description!") // (5)
.build();
AssetMutationResponse response = 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 anAtlanClientthrough which to connect to the tenant.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
client = 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.
val toUpdate = Persona.updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
true) // (4)
.description("Now with a description!") // (5)
.build()
val response = 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 anAtlanClientthrough which to connect to the tenant.
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.
{
"entities": [ // (1)
}
]
}
- Wrap all updates in an
entitiesarray. - 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.
Delete persona
To permanently delete a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
Persona.purge(client, "67e08ab7-9688-40bc-ae4a-da2bc06b1588"); // (1)
- 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 anAtlanClientthrough which to connect to the tenant.
from pyatlan.client.atlan import AtlanClient
client = AtlanClient()
client.asset.purge_by_guid("67e08ab7-9688-40bc-ae4a-da2bc06b1588") # (1)
- To permanently delete a persona in Atlan, call the
asset.purge_by_guid()method with the GUID of the persona.
Persona.purge(client, "67e08ab7-9688-40bc-ae4a-da2bc06b1588") // (1)
- 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 anAtlanClientthrough which to connect to the tenant.
assets.PurgeByGuid([]string{"67e08ab7-9688-40bc-ae4a-da2bc06b1588"}) // (1)
- To permanently delete a persona in Atlan, call the
assets.PurgeByGuid()method with the GUID of the persona.
// (1)
- All the details for deleting the persona are specified in the URL directly. Note that you must provide the GUID of the persona to delete it.
Activate or deactivate persona
Alternatively, if you only want to temporarily deactivate a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
Persona toUpdate = Persona.updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
false) // (4)
.build();
AssetMutationResponse response = toUpdate.save(client); // (5)
- Use the
updater()method to update 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. Setting this to
falsewill deactivate the persona, while setting it totruewill 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 anAtlanClientthrough which to connect to the tenant.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
client = AtlanClient()
to_update = Persona.updater( # (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", # (2)
"Data Assets", # (3)
False # (4)
)
response = client.asset.save(to_update) # (5)
- Use the
updater()method to update the persona. - 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
Falsewill deactivate the persona, while setting it toTruewill activate the persona. - To then apply that activation / deactivation to the persona in Atlan, call the
save()method with the object you've built.
val toUpdate = Persona.updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
false) // (4)
.build()
val response = toUpdate.save(client) // (5)
- Use the
updater()method to update 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. Setting this to
falsewill deactivate the persona, while setting it totruewill 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 anAtlanClientthrough which to connect to the tenant.
toUpdate := &assets.Persona{}
toUpdate.Updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
false, // (4)
)
response, atlanErr := assets.Save(toUpdate) // (5)
- Use the
Updater()method to update 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. Setting this to
Falsewill deactivate the persona, while setting it toTruewill activate the persona. - To then apply that activation / deactivation to the persona in Atlan, call the
Save()method with the object you've built.
{
"entities": [ // (1)
}
]
}
- Wrap all updates in an
entitiesarray. - 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
falsewill deactivate the persona, while setting it totruewill activate the persona.
Add subjects to persona
Similarly, adding subjects to a persona is a matter of updating the persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
Persona toUpdate = Persona.updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
false) // (4)
.personaGroup("group1") // (5)
.personaGroup("group2")
.personaUser("jsmith") // (6)
.personaUser("jdoe")
.build();
AssetMutationResponse response = toUpdate.save(client); // (7)
- Use the
updater()method to update 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 anAtlanClientthrough which to connect to the tenant.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
client = AtlanClient()
to_update = Persona.updater( # (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", # (2)
"Data Assets", # (3)
True # (4)
)
to_update.persona_groups = ["group1", "group2"] # (5)
to_update.persona_users = ["jsmith", "jdoe"] # (6)
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 any number of groups to the
persona_groupsproperty. 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_usersproperty. 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.
val toUpdate = Persona.updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
false) // (4)
.personaGroup("group1") // (5)
.personaGroup("group2")
.personaUser("jsmith") // (6)
.personaUser("jdoe")
.build()
val response = toUpdate.save(client) // (7)
- Use the
updater()method to update 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 anAtlanClientthrough which to connect to the tenant.
toUpdate := &assets.Persona{}
toUpdate.Updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
false, // (4)
)
toUpdate.PersonaGroups = &[]string{"group1", "group2"} // (5)
toUpdate.PersonaUsers = &[]string{"jsmith", "jdoe"} // (6)
response, atlanErr := assets.Save(toUpdate) // (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 any number of groups to the
PersonaGroupsproperty. 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
PersonaUsersproperty. 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.
{
"entities": [ // (1)
}
]
}
- Wrap all updates in an
entitiesarray. - 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
personaGroupsproperty. 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
personaUsersproperty. These should be usernames of users that you want to be controlled through the persona's policies.
Add policies to persona
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.
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.
Add metadata policy
To add a metadata policy to a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
AuthPolicy metadata = Persona.createMetadataPolicy( // (1)
"Simple read access", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
AuthPolicyType.ALLOW, // (4)
Set.of(PersonaMetadataAction.READ), // (5)
"default/snowflake/1234567890", // (6)
Set.of("entity:default/snowflake/1234567890")) // (7)
.build();
AssetMutationResponse response = metadata.save(client); // (8)
-
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()).
:::
6. Specify the qualifiedName of the connection whose assets this policy should control.
7. 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.
8. 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.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
from pyatlan.model.enums import AuthPolicyType, PersonaMetadataAction
client = AtlanClient()
metadata = Persona.create_metadata_policy( # (1)
client=client, # (2)
name="Simple read access", # (3)
persona_id="67e08ab7-9688-40bc-ae4a-da2bc06b1588", # (4)
policy_type=AuthPolicyType.ALLOW, # (5)
actions={PersonaMetadataAction.READ}, # (6)
connection_qualified_name="default/snowflake/1234567890", # (7)
resources={"entity:default/snowflake/1234567890"}, # (8)
)
response = client.asset.save(metadata) # (9)
- Use the
create_metadata_policy()method to start building a metadata policy with the minimal required information. - You must provide a client instance.
- 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_nameof the connection whose assets this policy should control. - Specify the set of
qualified_nameprefixes for the assets this policy should control. Eachqualified_nameshould itself be prefixed withentity:. To control all assets within a connection, this can simply be thequalified_nameof the connection itself. - To then add the policy to the persona in Atlan, call the
save()method with the policy object you've built.
val metadata = Persona.createMetadataPolicy( // (1)
"Simple read access", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
AuthPolicyType.ALLOW, // (4)
setOf(PersonaMetadataAction.READ), // (5)
"default/snowflake/1234567890", // (6)
setOf("entity:default/snowflake/1234567890")) // (7)
.build()
val response = metadata.save(client) // (8)
-
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().
:::
6. Specify the qualifiedName of the connection whose assets this policy should control.
7. 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.
8. 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.
Persona := &assets.Persona{}
metadata, _ := Persona.CreateMetadataPolicy( // (1)
"Simple read access", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
atlan.AuthPolicyTypeAllow, // (4)
[]atlan.PersonaMetadataAction{atlan.PersonaMetadataActionRead}, // (5)
"default/snowflake/1234567890", // (6)
[]string{"entity:default/snowflake/1234567890"}, // (7)
)
response, atlanErr := assets.Save(metadata) // (8)
- 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
qualifiedNameof the connection whose assets this policy should control. - Specify the set of
qualifiedNameprefixes for the assets this policy should control. EachqualifiedNameshould itself be prefixed withentity:. To control all assets within a connection, this can simply be thequalifiedNameof the connection itself. - To then add the policy to the persona in Atlan, call the
save()method with the policy object you've built.
{
"entities": [ // (1),
"policyResourceCategory": "CUSTOM" // (15)
}
}
]
}
-
Wrap all updates in an
entitiesarray. -
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
qualifiedNameof the connection whose assets will be controlled by this policy. -
Specify the set of
qualifiedNameprefixes for the assets this policy should control. EachqualifiedNameshould itself be prefixed withentity:. To control all assets within a connection, this can simply be thequalifiedNameof 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.
:::
12. Use an embedded accessControl object to define the persona to attach this policy to.
13. The embedded type name of the accessControl object must be exactly Persona.
14. You must provide the GUID of the persona to attach this policy to.
15. You must set the policy resource category to CUSTOM.
Add data policy
To add a data policy to a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
AuthPolicy data = Persona.createDataPolicy( // (1)
"Allow access to data", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
AuthPolicyType.ALLOW, // (4)
"default/snowflake/1234567890", // (5)
Set.of("entity:default/snowflake/1234567890")) // (6)
.build();
AssetMutationResponse response = data.save(client); // (7)
- 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
qualifiedNameof the connection whose assets this policy should control. - Specify the set of
qualifiedNameprefixes for the assets this policy should control. EachqualifiedNameshould itself be prefixed withentity:. To control all assets within a connection, this can simply be thequalifiedNameof 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 anAtlanClientthrough which to connect to the tenant.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
from pyatlan.model.enums import AuthPolicyType
client = AtlanClient()
data = Persona.create_data_policy( # (1)
client=client, # (2)
name="Allow access to data", # (3)
persona_id="67e08ab7-9688-40bc-ae4a-da2bc06b1588", # (4)
policy_type=AuthPolicyType.ALLOW, # (5)
connection_qualified_name="default/snowflake/1234567890", # (6)
resources={"entity:default/snowflake/1234567890"}, # (7)
)
response = client.asset.save(data) # (8)
- Use the
create_data_policy()method to start building a data policy with the minimal required information. - You must provide a client instance.
- 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
qualifiedNameof the connection whose assets this policy should control. - Specify the set of
qualified_nameprefixes for the assets this policy should control. Eachqualified_nameshould itself be prefixed withentity:. To control all assets within a connection, this can simply be thequalified_nameof the connection itself. - To then add the policy to the persona in Atlan, call the
save()method with the policy object you've built.
val data = Persona.createDataPolicy( // (1)
"Allow access to data", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
AuthPolicyType.ALLOW, // (4)
"default/snowflake/1234567890", // (5)
setOf("entity:default/snowflake/1234567890")) // (6)
.build()
val response = data.save(client) // (7)
- 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
qualifiedNameof the connection whose assets this policy should control. - Specify the set of
qualifiedNameprefixes for the assets this policy should control. EachqualifiedNameshould itself be prefixed withentity:. To control all assets within a connection, this can simply be thequalifiedNameof 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 anAtlanClientthrough which to connect to the tenant.
Persona := &assets.Persona{}
data, _ := Persona.CreateDataPolicy( // (1)
"Allow access to data", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
atlan.AuthPolicyTypeAllow, // (4)
"default/snowflake/1234567890", // (5)
[]string{"entity:default/snowflake/1234567890"}, // (6)
)
response, atlanErr := assets.Save(data) // (7)
- 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
qualifiedNameof the connection whose assets this policy should control. - Specify the set of
qualifiedNameprefixes for the assets this policy should control. EachqualifiedNameshould itself be prefixed withentity:. To control all assets within a connection, this can simply be thequalifiedNameof the connection itself. - To then add the policy to the persona in Atlan, call the
Save()method with the policy object you've built.
{
"entities": [ // (1),
"policyResourceCategory": "ENTITY" // (16)
}
}
]
}
- Wrap all updates in an
entitiesarray. - 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
qualifiedNameof 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
qualifiedNameprefixes for the assets this policy should control. EachqualifiedNameshould itself be prefixed withentity:. To control all assets within a connection, this can simply be thequalifiedNameof 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
selectpermissions. - Use an embedded
accessControlobject to define the persona to attach this policy to. - The embedded type name of the
accessControlobject must be exactlyPersona. - You must provide the GUID of the persona to attach this policy to.
- You must set the policy resource category to
ENTITY.
Add glossary policy
To add a glossary policy to a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
AuthPolicy glossary = Persona.createGlossaryPolicy( // (1)
"All glossaries", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
AuthPolicyType.ALLOW, // (4)
Set.of(PersonaGlossaryAction.CREATE, PersonaGlossaryAction.UPDATE), // (5)
Set.of("entity:OpU9a9kG825gAqpamXugf")) // (6)
.build();
AssetMutationResponse response = glossary.save(client); // (7)
-
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()).
:::
6. Specify the set of qualifiedNames of glossaries this policy should control. Each qualifiedName should itself be prefixed with entity:.
7. 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.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
from pyatlan.model.enums import AuthPolicyType, PersonaGlossaryAction
client = AtlanClient()
glossary = Persona.create_glossary_policy( # (1)
name="All glossaries", # (2)
persona_id="67e08ab7-9688-40bc-ae4a-da2bc06b1588", # (3)
policy_type=AuthPolicyType.ALLOW, # (4)
actions={PersonaGlossaryAction.CREATE, PersonaGlossaryAction.UPDATE}, # (5)
resources={"entity:OpU9a9kG825gAqpamXugf"}, # (6)
)
response = client.asset.save(glossary) # (7)
- Use the
create_glossary_policy()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.
- Specify the set of
qualified_names of glossaries this policy should control. Eachqualified_nameshould itself be prefixed withentity:. - To then add the policy to the persona in Atlan, call the
save()method with the policy object you've built.
val glossary = Persona.createGlossaryPolicy( // (1)
"All glossaries", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
AuthPolicyType.ALLOW, // (4)
setOf(PersonaGlossaryAction.CREATE, PersonaGlossaryAction.UPDATE), // (5)
setOf("entity:OpU9a9kG825gAqpamXugf")) // (6)
.build()
val response = glossary.save(client) // (7)
-
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().
:::
6. Specify the set of qualifiedNames of glossaries this policy should control. Each qualifiedName should itself be prefixed with entity:.
7. 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.
Persona := &assets.Persona{}
glossary, _ := Persona.CreateGlossaryPolicy( // (1)
"All glossaries", // (2)
"67e08ab7-9688-40bc-ae4a-da2bc06b1588", // (3)
atlan.AuthPolicyTypeAllow, // (4)
[]atlan.PersonaGlossaryAction{atlan.PersonaGlossaryActionCreate, atlan.PersonaGlossaryActionUpdate}, // (5)
[]string{"entity:OpU9a9kG825gAqpamXugf"}, // (6)
)
response, err := assets.Save(glossary) // (7)
- 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.
- Specify the set of
qualifiedNames of glossaries this policy should control. EachqualifiedNameshould itself be prefixed withentity:. - To then add the policy to the persona in Atlan, call the
Save()method with the policy object you've built.
{
"entities": [ // (1),
"policyResourceCategory": "CUSTOM" // (14)
}
}
]
}
-
Wrap all updates in an
entitiesarray. -
For each embedded object, use the exact type name
AuthPolicy. -
You must use a policy subcategory of
glossary. -
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 set of
qualifiedNames of glossaries this policy should control. EachqualifiedNameshould itself be prefixed withentity:. -
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 PersonaGlossaryAction enum in the Java SDK.
:::
11. Use an embedded accessControl object to define the persona to attach this policy to.
12. The embedded type name of the accessControl object must be exactly Persona.
13. You must provide the GUID of the persona to attach this policy to.
14. You must set the policy resource category to CUSTOM.
Add domain policy
To add a domain policy to a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
AuthPolicy domain = 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();
AssetMutationResponse response = 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()).
:::
5. 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.
6. 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.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
from pyatlan.model.enums import AuthPolicyType, PersonaDomainAction
client = 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. Eachqualified_nameshould itself be prefixed withentity:. To control all domains, this can simply be a single value ofentity:All domains. - To then add the policy to the persona in Atlan, call the
save()method with the policy object you've built.
val domain = 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()
val response = 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().
:::
5. 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.
6. 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.
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. EachqualifiedNameshould itself be prefixed withentity:. To control all domains, this can simply be a single value ofentity: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),
"policyResourceCategory": "CUSTOM" // (14)
}
}
]
}
-
Wrap all updates in an
entitiesarray. -
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. EachqualifiedNameshould itself be prefixed withentity:. To control all domains, this can simply be a single value ofentity: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.
:::
11. Use an embedded accessControl object to define the persona to attach this policy to.
12. The embedded type name of the accessControl object must be exactly Persona.
13. You must provide the GUID of the persona to attach this policy to.
14. You must set the policy resource category to CUSTOM.
List policies in persona
To list all the policies in a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
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 -> a instanceof Persona)
.forEach(p -> { // (6)
Set<IAuthPolicy> policies = ((Persona) p).getPolicies();
for (IAuthPolicy policy : policies)
});
- Start by selecting a persona, here using a FluentSearch-based approach. Because this operation will retrieve information from Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - You can select the persona by whatever you like, in this example we're 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're 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.
from typing import cast
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona, AuthPolicy
from pyatlan.model.fluent_search import FluentSearch
client = 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)
for p in response: # (7)
policies = cast(Persona, p).policies
for policy in policies:
# 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're 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're 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.
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 { it is Persona }
.forEach { // (6)
val policies = (it as Persona).policies
for (policy in policies)
}
- Start by selecting a persona, here using a FluentSearch-based approach. Because this operation will retrieve information from Atlan, you must provide it an
AtlanClientthrough which to connect to the tenant. - You can select the persona by whatever you like, in this example we're 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're 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.
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)
if atlanErr != nil {
fmt.Println("Error:", atlanErr)
}
for _, entity := range response[0].Entities { // (6)
if entity.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're 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're 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.
{
"dsl": { // (1)
"query": {
"bool": {
"filter": [
{
"term": {
"__typeName.keyword": {
"value": "Persona"
}
}
},
{
"term": {
"__state": {
"value": "ACTIVE"
}
}
},
{
"term": {
"name.keyword": {
"value": "Data Assets" // (2)
}
}
}
]
}
},
"sort": [
{
"__guid": {
"order": "asc"
}
}
],
"track_total_hits": true
},
"attributes": [
"policies" // (3)
],
"relationAttributes": [ // (4)
"name",
"policyType",
"policyResources",
"policyActions"
],
"suppressLogs": true,
"showSearchScore": false,
"excludeMeanings": false,
"excludeClassifications": false
}
- Start by running a search for personas.
- You can select the persona by whatever you like, in this example we're selecting based on its name.
- Include the
policiesfor 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're including the name, type, actions and resources controlled by each policy.
Personalize persona
To personalize which details to show for assets within a persona:
- Java
- Python
- Kotlin
- Go
- Raw REST API
Persona toUpdate = Persona.updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
true) // (4)
.denyAssetTab(AssetSidebarTab.LINEAGE) // (5)
.denyAssetTab(AssetSidebarTab.RELATIONS)
.denyAssetTab(AssetSidebarTab.QUERIES)
.denyAssetType("Table") // (6)
.denyAssetType("Column")
.denyAssetFilter(AssetFilterGroup.TAGS) // (7)
.denyAssetFilter(AssetFilterGroup.OWNERS)
.denyAssetFilter(AssetFilterGroup.CERTIFICATE)
.denyCustomMetadataGuid("59220d25-5d39-4f3a-8de5-072098bee793") // (8)
.denyCustomMetadataGuid("bb0c9836-94fd-4a54-9007-0f25fb802c2c")
.build();
AssetMutationResponse response = toUpdate.save(client); // (9)
- 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 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 anAtlanClientthrough which to connect to the tenant.
from pyatlan.client.atlan import AtlanClient
from pyatlan.model.assets import Persona
from pyatlan.model.enums import AssetSidebarTab, AssetFilterGroup
client = AtlanClient()
to_update = Persona.updater( # (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", # (2)
"Data Assets", # (3)
True # (4)
)
to_update.deny_asset_tabs = { # (5)
AssetSidebarTab.LINEAGE.value,
AssetSidebarTab.RELATIONS.value,
AssetSidebarTab.QUERIES.value,
}
to_update.deny_asset_types = {"Table", "Column"} # (6)
to_update.deny_asset_filters = { # (7)
AssetFilterGroup.TAGS.value,
AssetFilterGroup.OWNERS.value,
AssetFilterGroup.CERTIFICATE.value,
}
to_update.deny_custom_metadata_guids = { # (8)
"59220d25-5d39-4f3a-8de5-072098bee793",
"bb0c9836-94fd-4a54-9007-0f25fb802c2c",
}
response = client.asset.save(to_update) # (9)
- 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 set 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 with the object you've built.
val toUpdate = Persona.updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
true) // (4)
.denyAssetTab(AssetSidebarTab.LINEAGE) // (5)
.denyAssetTab(AssetSidebarTab.RELATIONS)
.denyAssetTab(AssetSidebarTab.QUERIES)
.denyAssetType("Table") // (6)
.denyAssetType("Column")
.denyAssetFilter(AssetFilterGroup.TAGS) // (7)
.denyAssetFilter(AssetFilterGroup.OWNERS)
.denyAssetFilter(AssetFilterGroup.CERTIFICATE)
.denyCustomMetadataGuid("59220d25-5d39-4f3a-8de5-072098bee793") // (8)
.denyCustomMetadataGuid("bb0c9836-94fd-4a54-9007-0f25fb802c2c")
.build()
val response = toUpdate.save(client) // (9)
- 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 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 anAtlanClientthrough which to connect to the tenant.
toUpdate := &assets.Persona{}
toUpdate.Updater( // (1)
"default/M5HnBQ8QWhrAVGuvBx8iSW", // (2)
"Data Assets", // (3)
true, // (4)
)
toUpdate.DenyAssetTabs = &[]string{ // (5)
atlan.AssetSidebarTabLineage.Name,
atlan.AssetSidebarTabRelations.Name,
atlan.AssetSidebarTabQueries.Name,
}
toUpdate.DenyAssetTypes = &[]string{"Table", "Column"} // (6)
toUpdate.DenyAssetFilters = &[]string{ // (7)
atlan.AssetFilterGroupTags.Name,
atlan.AssetFilterGroupOwners.Name,
atlan.AssetFilterGroupCertificate.Name,
}
toUpdate.DenyCustomMetadataGuids = &[]string{ // (8)
"59220d25-5d39-4f3a-8de5-072098bee793",
"bb0c9836-94fd-4a54-9007-0f25fb802c2c",
}
response, atlanErr := assets.Save(toUpdate) // (9)
- 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 set 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 with the object you've built.
{
"entities": [ // (1)
}
]
}
- Wrap all updates in an
entitiesarray. - 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 set 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 review the values of tabs and filters, refer to the SDKs.
For example, check the AssetSidebarTab and AssetFilterGroup enums in the SDKs.