Oggetto Roles (TMSL)
Si applica a:
SQL Server 2016 e versioni successive Analysis Services
Azure Analysis Services
Power BI Premium
Definisce un ruolo nel modello che specifica una raccolta di autorizzazioni. L'appartenenza ai ruoli è Windows entità di sicurezza. È possibile impostare filtri per un ruolo per limitare l'accesso a oggetti specifici.
Definizione dell'oggetto
Tutti gli oggetti hanno un set comune di proprietà, tra cui nome, tipo, descrizione, raccolta di proprietà e annotazioni. Gli oggetti ruolo hanno anche le proprietà seguenti.
ModelPermission
Stabilisce un ambito di autorizzazioni per un database. I valori validi sono none,
Leggere
readRefresh,
aggiornare
e amministratore.
members
I membri sono costituiti sia da un nome di membro che da un ID, dove nome membro è l'alias o nome descrittivo di un'entità di sicurezza Windows e l'ID è l'ID di sicurezza. Entrambi sono specificati nella definizione del ruolo.
tablePermissions
Un'autorizzazione di tabella è un oggetto denominato con autorizzazioni definite tramite un'espressione DAX. Questa proprietà è facoltativa, usata per applicare un filtro di sicurezza.
Utilizzo
Gli oggetti ruolo vengono usati nei comandi Alter (TMSL), Create command (TMSL), CreateOrReplace (TMSL)e Delete (TMSL).
Un oggetto Role è una proprietà di un modello, ma può anche essere specificato come proprietà di un oggetto Database in base al mapping uno-a-uno tra Model e Database.
Durante la creazione, la sostituzione o la modifica di un oggetto ruolo, specificare tutte le proprietà di lettura/scrittura della definizione dell'oggetto. L'omissione di una proprietà di lettura/scrittura è considerata un'eliminazione.
Sintassi completa
Di seguito è riportata la rappresentazione dello schema di un oggetto ruolo di un modello.
"roles": {
"type": "array",
"items": {
"description": "ModelRole object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"description": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"modelPermission": {
"enum": [
"none",
"read",
"readRefresh",
"refresh",
"administrator"
]
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
},
"members": {
"type": "array",
"items": {
"anyOf": [
{
"description": "WindowsModelRoleMember object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"memberName": {
"type": "string"
},
"memberId": {
"type": "string"
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
},
{
"description": "ExternalModelRoleMember object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"memberName": {
"type": "string"
},
"memberId": {
"type": "string"
},
"identityProvider": {
"type": "string"
},
"memberType": {
"enum": [
"auto",
"user",
"group"
]
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
]
}
},
"tablePermissions": {
"type": "array",
"items": {
"description": "TablePermission object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"filterExpression": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
},
"annotations": {
"type": "array",
"items": {
"description": "Annotation object of Tabular Object Model (TOM)",
"type": "object",
"properties": {
"name": {
"type": "string"
},
"value": {
"anyOf": [
{
"type": "string"
},
{
"type": "array",
"items": {
"type": "string"
}
}
]
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}
},
"additionalProperties": false
}
}