mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Improve checks for API user permissions
This commit is contained in:
parent
c8fa6bd992
commit
21e7a976ee
3 changed files with 11 additions and 3 deletions
|
|
@ -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"));
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue