mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-13 03:26:24 +00:00
Company create (#610)
* API: refactor checkPermission - Rename to checkRole (actually what it is doing) - Permission check will be incoming * Add checkPermission function for API * Create a new company * Bump release notes * Cleanup * Fix
This commit is contained in:
parent
0c5944a8a0
commit
1a3f48f48c
8 changed files with 129 additions and 22 deletions
|
|
@ -212,7 +212,7 @@ class InvenTreeModel {
|
|||
// Test if the user can "edit" this model
|
||||
bool get canEdit {
|
||||
for (String role in rolesRequired) {
|
||||
if (InvenTreeAPI().checkPermission(role, "change")) {
|
||||
if (InvenTreeAPI().checkRole(role, "change")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -224,7 +224,7 @@ class InvenTreeModel {
|
|||
// Test if the user can "create" this model
|
||||
bool get canCreate {
|
||||
for (String role in rolesRequired) {
|
||||
if (InvenTreeAPI().checkPermission(role, "add")) {
|
||||
if (InvenTreeAPI().checkRole(role, "add")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -236,7 +236,7 @@ class InvenTreeModel {
|
|||
// Test if the user can "delete" this model
|
||||
bool get canDelete {
|
||||
for (String role in rolesRequired) {
|
||||
if (InvenTreeAPI().checkPermission(role, "delete")) {
|
||||
if (InvenTreeAPI().checkRole(role, "delete")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -248,7 +248,7 @@ class InvenTreeModel {
|
|||
// Test if the user can "view" this model
|
||||
bool get canView {
|
||||
for (String role in rolesRequired) {
|
||||
if (InvenTreeAPI().checkPermission(role, "view")) {
|
||||
if (InvenTreeAPI().checkRole(role, "view")) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue