PowerPoint.SensitivityLabelAbacAttributeValue interface
Observação
Esta API é fornecida como uma versão prévia para desenvolvedores e pode ser alterada com base nos comentários que recebemos. Não use esta API em um ambiente de produção.
Representa um único valor selecionável de um atributo de controle de acesso baseado em atributo (ABAC) que pode ser aplicado a um rótulo de confidencialidade.
Comentários
Conjunto de APIs: PowerPointApi BETA (SOMENTE VISUALIZAÇÃO)
Usada por
- PowerPoint.SensitivityLabelAbacAttribute: valores
- PowerPoint.SensitivityLabelDetails: abacAttributeValues
Exemplos
// Link to full sample: https://raw.githubusercontent.com/OfficeDev/office-js-snippets/prod/samples/powerpoint/preview-apis/manage-sensitivity-labels.yaml
await PowerPoint.run(async (context) => {
// Get the sensitivity label currently applied to the presentation.
const presentation: PowerPoint.Presentation = context.presentation;
const presentationLabel: PowerPoint.SensitivityLabel = presentation.sensitivityLabel;
const currentLabel: PowerPoint.SensitivityLabelDetails = presentationLabel.getCurrentOrNullObject();
// Load the properties of the label currently applied to the presentation.
currentLabel.load(
"color,id,isAbacAttributesRequired,isAbacEnabled,isEnabled,name,order,protectionType,siteId,tooltip"
);
await context.sync();
if (currentLabel.isNullObject) {
console.log("The presentation doesn't have a sensitivity label.");
return;
}
// Get ABAC values when enabled for the label.
let abacAttributeValues: PowerPoint.SensitivityLabelAbacAttributeValue[] = [];
if (currentLabel.isAbacEnabled) {
currentLabel.load("abacAttributeValues");
await context.sync();
abacAttributeValues = currentLabel.abacAttributeValues;
}
// Display the loaded properties of the current label.
const attributeValues = abacAttributeValues.length
? abacAttributeValues
.map(
(attributeValue: PowerPoint.SensitivityLabelAbacAttributeValue) =>
`${attributeValue.displayName} (ID: ${attributeValue.id}, order: ${attributeValue.displayOrder}, active: ${attributeValue.isActive ? "Yes" : "No"})`
)
.join(", ")
: "None";
let protectionDescription: string;
switch (currentLabel.protectionType) {
case PowerPoint.SensitivityLabelProtectionType.adminDefined:
protectionDescription = "Defined by an administrator";
break;
case PowerPoint.SensitivityLabelProtectionType.userDefined:
protectionDescription = "Defined by the user";
break;
case PowerPoint.SensitivityLabelProtectionType.noProtection:
protectionDescription = "No protection";
break;
default:
protectionDescription = `Unknown (${currentLabel.protectionType})`;
break;
}
console.log(
`Current presentation sensitivity label:\n\n${currentLabel.name}\n` +
` ID: ${currentLabel.id}\n` +
` Site ID: ${currentLabel.siteId}\n` +
` Tooltip: ${currentLabel.tooltip}\n` +
` Color: ${currentLabel.color}\n` +
` Enabled: ${currentLabel.isEnabled ? "Yes" : "No"}\n` +
` Display order: ${currentLabel.order}\n` +
` ABAC enabled: ${currentLabel.isAbacEnabled ? "Yes" : "No"}\n` +
` ABAC attributes required: ${currentLabel.isAbacAttributesRequired ? "Yes" : "No"}\n` +
` ABAC attribute values: ${attributeValues}\n` +
` Protection type: ${protectionDescription}`
);
});
Propriedades
| display |
Obtém o nome de exibição do valor do atributo ABAC. Os suplementos são responsáveis por apresentar a interface do usuário localizada e voltada para o usuário. |
| display |
Obtém a ordenação recomendada desse valor ABAC em seu atributo quando exibido para um usuário. |
| id | Obtém o identificador exclusivo do valor do atributo ABAC. Esse identificador é usado ao aplicar ou atualizar as seleções de atributos ABAC do rótulo. |
| is |
Obtém se este valor de atributo ABAC está ativo.
|
Detalhes da propriedade
displayName
Observação
Esta API é fornecida como uma versão prévia para desenvolvedores e pode ser alterada com base nos comentários que recebemos. Não use esta API em um ambiente de produção.
Obtém o nome de exibição do valor do atributo ABAC. Os suplementos são responsáveis por apresentar a interface do usuário localizada e voltada para o usuário.
displayName: string;
Valor da propriedade
string
Comentários
displayOrder
Observação
Esta API é fornecida como uma versão prévia para desenvolvedores e pode ser alterada com base nos comentários que recebemos. Não use esta API em um ambiente de produção.
Obtém a ordenação recomendada desse valor ABAC em seu atributo quando exibido para um usuário.
displayOrder: number;
Valor da propriedade
number
Comentários
id
Observação
Esta API é fornecida como uma versão prévia para desenvolvedores e pode ser alterada com base nos comentários que recebemos. Não use esta API em um ambiente de produção.
Obtém o identificador exclusivo do valor do atributo ABAC. Esse identificador é usado ao aplicar ou atualizar as seleções de atributos ABAC do rótulo.
id: string;
Valor da propriedade
string
Comentários
isActive
Observação
Esta API é fornecida como uma versão prévia para desenvolvedores e pode ser alterada com base nos comentários que recebemos. Não use esta API em um ambiente de produção.
Obtém se este valor de atributo ABAC está ativo.
true se o valor estiver ativo; caso contrário, false.
isActive: boolean;
Valor da propriedade
boolean