mirror of
https://github.com/inventree/inventree-app.git
synced 2026-10-06 23:32:11 +00:00
Improve checks for API user permissions
This commit is contained in:
1 parent
c8fa6bd992
commit
21e7a976ee
3 files changed
+11
-3
No files matched your search
+4
-1
@@ -129,10 +129,13 @@ void main() {
|
||||
assert(api.supportsNotifications);
|
||||
assert(api.supportsPoReceive);
|
||||
|
||||
// Ensure we can request (and receive) user roles
|
||||
assert(await api.getUserRoles());
|
||||
|
||||
// Check available permissions
|
||||
assert(api.checkPermission("part", "change"));
|
||||
assert(api.checkPermission("stocklocation", "delete"));
|
||||
assert(api.checkPermission("part", "weirdpermission"));
|
||||
assert(!api.checkPermission("part", "weirdpermission"));
|
||||
assert(api.checkPermission("blah", "bloo"));
|
||||
});
|
||||
|
||||
|
||||
Reference in new issue
Block a user