From 5ec86c4ade7f5c3cff5dd10fc07106ee9adce168 Mon Sep 17 00:00:00 2001 From: Oliver Date: Tue, 15 Apr 2025 15:45:03 +1000 Subject: [PATCH] Tweak required roles (#630) - Ref: https://github.com/inventree/InvenTree/pull/9506 --- lib/inventree/part.dart | 2 +- lib/inventree/stock.dart | 2 +- test/api_test.dart | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/inventree/part.dart b/lib/inventree/part.dart index 29fa99ea..3070c85f 100644 --- a/lib/inventree/part.dart +++ b/lib/inventree/part.dart @@ -27,7 +27,7 @@ class InvenTreePartCategory extends InvenTreeModel { static const String MODEL_TYPE = "partcategory"; @override - List get rolesRequired => ["part_category"]; + List get rolesRequired => ["part"]; @override Map> formFields() { diff --git a/lib/inventree/stock.dart b/lib/inventree/stock.dart index baa328a9..3f8ca972 100644 --- a/lib/inventree/stock.dart +++ b/lib/inventree/stock.dart @@ -644,7 +644,7 @@ class InvenTreeStockLocation extends InvenTreeModel { static const String MODEL_TYPE = "stocklocation"; @override - List get rolesRequired => ["stock_location"]; + List get rolesRequired => ["stock"]; String get pathstring => getString("pathstring"); diff --git a/test/api_test.dart b/test/api_test.dart index 2a6145f5..6b2554fa 100644 --- a/test/api_test.dart +++ b/test/api_test.dart @@ -118,7 +118,7 @@ void main() { // Check available permissions assert(api.checkRole("part", "change")); - assert(api.checkRole("stock_location", "delete")); + assert(api.checkRole("stock", "delete")); assert(!api.checkRole("part", "weirdpermission")); assert(api.checkRole("blah", "bloo"));