Commit f9ef354b authored by Samir Sadyhov's avatar Samir Sadyhov 🤔

Канбан-доска - добавлена проверка прав на фильтры

parent e15f649b
......@@ -642,6 +642,19 @@ const KanbanBoard = {
},
updateRigths: function(){
if(this.filterCode) {
const selectFilter = this.registryFilters.find(x => x.code == this.filterCode);
if(selectFilter) {
this.allRights = [...selectFilter.rights];
} else {
this.allRights = [...this.registryRights];
}
} else {
this.allRights = [...this.registryRights];
}
},
reset: function(){
this.selectedItems = [];
this.columns.forEach(column => column.currentPage = 0);
......@@ -671,9 +684,17 @@ const KanbanBoard = {
const registry = registryList.find(x => x.registryCode == registryCode);
if(registry) {
if(!registry.rights.includes("rr_list")) throw new Error(`Нет прав на просмотр данного реестра`);
const info = await appAPI.getRegistryInfo(registryCode);
this.registryFilters = await appAPI.getRegistryFilters(registryCode);
this.registryCode = registryCode;
this.filterCode = filterCode;
this.registryID = info.registryID;
this.registryName = registry.registryName;
this.registryRights = registry.rights;
this.updateRigths();
if(!this.allRights.includes("rr_list")) throw new Error(`Нет прав на просмотр данного реестра`);
this.heads = info.columns.filter(item => item.visible != '0')
.sort((a, b) => {
......@@ -684,11 +705,6 @@ const KanbanBoard = {
return {label: item.label, columnID: item.columnID}
});
this.registryCode = registryCode;
this.filterCode = filterCode;
this.registryID = info.registryID;
this.registryName = registry.registryName;
this.rights = registry.rights;
this.formCode = info.formCode;
this.formId = info.formId;
this.formName = info.name;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment