Sets custom CSS styles for rows of a Document List according to the item's permissions.
Property | Type | Description |
---|---|---|
isFile | boolean | Does this style apply to files? |
isFolder | boolean | Does this style apply to folders? |
permission | Permissions | An enum value defining the permissions that this style applies to (see below) |
css | string | The name of the CSS class to add |
You can customize the style of a Document List row based on the user's
permissions for that item. The list has a permissionsStyle
property containing an array of
Permission Style model objects. These objects associate a particular CSS style with a permission level
and can be applied separately to files and folders by setting isFile
and isFolder
appropriately.
The Allowable Operations enum contains all the valid permissions for which you can apply custom styles: DELETE, UPDATE, CREATE, UPDATEPERMISSIONS, NOT_DELETE, NOT_UPDATE, NOT_CREATE, NOT_UPDATEPERMISSIONS.
If you want to change the style on rows where the user can create content:
let permissionsStyle: PermissionStyleModel[] = []; this.permissionsStyle.push(new PermissionStyleModel('document-list__create', AllowableOperationsEnum.CREATE));
<adf-document-list [permissionsStyle]="permissionsStyle">
</adf-document-list>
adf-document-list adf-datatable .document-list__create {
background: green !important;
}
If you want to change the style on the folders where the user doesn't have the permission to update:
let permissionsStyle: PermissionStyleModel[] = []; this.permissionsStyle.push(new PermissionStyleModel('document-list__disable', AllowableOperationsEnum.NOT_UPDATE, false, true));
<adf-document-list [permissionsStyle]="permissionsStyle">
</adf-document-list>
adf-document-list adf-datatable .document-list__disable {
background: red !important;
}
© 2023 Alfresco Software, Inc. All Rights Reserved.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.