文件操作 - acl.ts
返回文件管理
返回主菜单
删除本文件
文件: /usr/share/grafana/public/app/core/utils/acl.ts
编辑文件内容
import { DashboardAcl, DashboardAclDTO } from 'app/types/acl'; export function processAclItems(items: DashboardAclDTO[]): DashboardAcl[] { return items.map(processAclItem).sort((a, b) => b.sortRank - a.sortRank || a.name.localeCompare(b.name)); } function processAclItem(dto: DashboardAclDTO): DashboardAcl { const item = dto as DashboardAcl; item.sortRank = 0; if (item.userId > 0) { item.name = item.userLogin; item.sortRank = 10; } else if (item.teamId > 0) { item.name = item.team; item.sortRank = 20; } else if (item.role) { item.icon = 'fa fa-fw fa-street-view'; item.name = item.role; item.sortRank = 30; if (item.role === 'Editor') { item.sortRank += 1; } } if (item.inherited) { item.sortRank += 100; } return item; }
修改文件时间
将文件时间修改为当前时间的前一年
删除文件