mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-29 14:06:47 +00:00
Check that the user has the required permisions
This commit is contained in:
parent
ed94d4eb96
commit
fcc5bf8c30
@ -273,26 +273,28 @@ class _CategoryDisplayState extends RefreshableState<CategoryDisplayWidget> {
|
|||||||
getCategoryDescriptionCard(extra: false),
|
getCategoryDescriptionCard(extra: false),
|
||||||
];
|
];
|
||||||
|
|
||||||
tiles.add(
|
if (InvenTreeAPI().checkPermission('part', 'add')) {
|
||||||
ListTile(
|
|
||||||
title: Text(L10().categoryCreate),
|
|
||||||
subtitle: Text(L10().categoryCreateDetail),
|
|
||||||
leading: FaIcon(FontAwesomeIcons.sitemap, color: COLOR_CLICK),
|
|
||||||
onTap: () async {
|
|
||||||
_newCategory(context);
|
|
||||||
},
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (category != null) {
|
|
||||||
tiles.add(
|
tiles.add(
|
||||||
ListTile(
|
ListTile(
|
||||||
title: Text(L10().partCreate),
|
title: Text(L10().categoryCreate),
|
||||||
subtitle: Text(L10().partCreateDetail),
|
subtitle: Text(L10().categoryCreateDetail),
|
||||||
leading: FaIcon(FontAwesomeIcons.shapes, color: COLOR_CLICK),
|
leading: FaIcon(FontAwesomeIcons.sitemap, color: COLOR_CLICK),
|
||||||
onTap: _newPart,
|
onTap: () async {
|
||||||
|
_newCategory(context);
|
||||||
|
},
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (category != null) {
|
||||||
|
tiles.add(
|
||||||
|
ListTile(
|
||||||
|
title: Text(L10().partCreate),
|
||||||
|
subtitle: Text(L10().partCreateDetail),
|
||||||
|
leading: FaIcon(FontAwesomeIcons.shapes, color: COLOR_CLICK),
|
||||||
|
onTap: _newPart,
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return tiles;
|
return tiles;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user