PowerPoint.SensitivityLabelAbacAttributeValue interface
Nota
Esta API se ofrece a los desarrolladores como versión preliminar y puede cambiar en función de los comentarios que recibamos. No utilice esta API en un entorno de producción.
Representa un único valor seleccionable de un atributo de control de acceso basado en atributos (ABAC) que se puede aplicar a una etiqueta de confidencialidad.
Comentarios
Conjunto de API: PowerPointApi BETA (SOLO VERSIÓN PRELIMINAR)
Usada por
- PowerPoint.SensitivityLabelAbacAttribute: values
- PowerPoint.SensitivityLabelDetails: abacAttributeValues
Ejemplos
// 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}`
);
});
Propiedades
| display |
Obtiene el nombre para mostrar del valor del atributo ABAC. Los complementos son responsables de presentar la interfaz de usuario localizada y accesible para el usuario. |
| display |
Obtiene el orden recomendado de este valor ABAC dentro de su atributo cuando se muestra a un usuario. |
| id | Obtiene el identificador único del valor del atributo ABAC. Este identificador se usa al aplicar o actualizar las selecciones de atributos ABAC de la etiqueta. |
| is |
Obtiene si este valor de atributo ABAC está activo.
|
Detalles de las propiedades
displayName
Nota
Esta API se ofrece a los desarrolladores como versión preliminar y puede cambiar en función de los comentarios que recibamos. No utilice esta API en un entorno de producción.
Obtiene el nombre para mostrar del valor del atributo ABAC. Los complementos son responsables de presentar la interfaz de usuario localizada y accesible para el usuario.
displayName: string;
Valor de propiedad
string
Comentarios
Conjunto de API: PowerPointApi BETA (SOLO VERSIÓN PRELIMINAR)
displayOrder
Nota
Esta API se ofrece a los desarrolladores como versión preliminar y puede cambiar en función de los comentarios que recibamos. No utilice esta API en un entorno de producción.
Obtiene el orden recomendado de este valor ABAC dentro de su atributo cuando se muestra a un usuario.
displayOrder: number;
Valor de propiedad
number
Comentarios
Conjunto de API: PowerPointApi BETA (SOLO VERSIÓN PRELIMINAR)
id
Nota
Esta API se ofrece a los desarrolladores como versión preliminar y puede cambiar en función de los comentarios que recibamos. No utilice esta API en un entorno de producción.
Obtiene el identificador único del valor del atributo ABAC. Este identificador se usa al aplicar o actualizar las selecciones de atributos ABAC de la etiqueta.
id: string;
Valor de propiedad
string
Comentarios
Conjunto de API: PowerPointApi BETA (SOLO VERSIÓN PRELIMINAR)
isActive
Nota
Esta API se ofrece a los desarrolladores como versión preliminar y puede cambiar en función de los comentarios que recibamos. No utilice esta API en un entorno de producción.
Obtiene si este valor de atributo ABAC está activo.
true Si el valor está activo; de lo contrario, false.
isActive: boolean;
Valor de propiedad
boolean
Comentarios
Conjunto de API: PowerPointApi BETA (SOLO VERSIÓN PRELIMINAR)