Commit 07934691 by Marcus Efraimsson

use inherited property from api when rendering permissions

parent d86ed679
...@@ -41,7 +41,7 @@ export default observer(({ item, removeItem, permissionChanged, itemIndex, folde ...@@ -41,7 +41,7 @@ export default observer(({ item, removeItem, permissionChanged, itemIndex, folde
permissionChanged(itemIndex, permissionOption.value, permissionOption.label); permissionChanged(itemIndex, permissionOption.value, permissionOption.label);
}; };
const inheritedFromRoot = item.dashboardId === -1 && folderInfo && folderInfo.id === 0; const inheritedFromRoot = item.dashboardId === -1 && !item.inherited;
return ( return (
<tr className={setClassNameHelper(item.inherited)}> <tr className={setClassNameHelper(item.inherited)}>
......
...@@ -16,6 +16,7 @@ describe('PermissionsStore', () => { ...@@ -16,6 +16,7 @@ describe('PermissionsStore', () => {
permissionName: 'View', permissionName: 'View',
teamId: 1, teamId: 1,
team: 'MyTestTeam', team: 'MyTestTeam',
inherited: true,
}, },
{ {
id: 5, id: 5,
......
...@@ -224,8 +224,6 @@ const prepareServerResponse = (response, dashboardId: number, isFolder: boolean, ...@@ -224,8 +224,6 @@ const prepareServerResponse = (response, dashboardId: number, isFolder: boolean,
}; };
const prepareItem = (item, dashboardId: number, isFolder: boolean, isInRoot: boolean) => { const prepareItem = (item, dashboardId: number, isFolder: boolean, isInRoot: boolean) => {
item.inherited = !isFolder && !isInRoot && dashboardId !== item.dashboardId;
item.sortRank = 0; item.sortRank = 0;
if (item.userId > 0) { if (item.userId > 0) {
item.name = item.userLogin; item.name = item.userLogin;
......
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