2
0
mirror of https://github.com/inventree/InvenTree.git synced 2025-06-13 18:45:40 +00:00

Add 'users' permission role

This commit is contained in:
Oliver Walters
2025-04-08 05:06:27 +00:00
parent 6eae96ee17
commit 35b047b2f9
2 changed files with 20 additions and 11 deletions

View File

@ -226,6 +226,7 @@ class RuleSet(models.Model):
('purchase_order', _('Purchase Orders')),
('sales_order', _('Sales Orders')),
('return_order', _('Return Orders')),
('users', _('Users')),
]
RULESET_NAMES = [choice[0] for choice in RULESET_CHOICES]
@ -246,15 +247,6 @@ class RuleSet(models.Model):
'report_reportasset',
'report_reportsnippet',
'report_reporttemplate',
'account_emailaddress',
'account_emailconfirmation',
'socialaccount_socialaccount',
'socialaccount_socialapp',
'socialaccount_socialtoken',
'otp_totp_totpdevice',
'otp_static_statictoken',
'otp_static_staticdevice',
'mfa_authenticator',
'plugin_pluginconfig',
'plugin_pluginsetting',
'plugin_notificationusersetting',
@ -336,6 +328,23 @@ class RuleSet(models.Model):
'order_returnorderlineitem',
'order_returnorderextraline',
],
'users': [
'auth_group',
'auth_user',
'auth_permission',
'users_owner',
'users_apitoken',
'users_ruleset',
'account_emailaddress',
'account_emailconfirmation',
'socialaccount_socialaccount',
'socialaccount_socialapp',
'socialaccount_socialtoken',
'otp_totp_totpdevice',
'otp_static_statictoken',
'otp_static_staticdevice',
'mfa_authenticator',
],
}
if settings.SITE_MULTI:
@ -366,7 +375,6 @@ class RuleSet(models.Model):
'common_inventreecustomuserstatemodel',
'common_selectionlistentry',
'common_selectionlist',
'users_owner',
'users_userprofile', # User profile is handled in the serializer - only own user can change
# Third-party tables
'error_report_error',

View File

@ -11,7 +11,8 @@ export enum UserRoles {
sales_order = 'sales_order',
stock = 'stock',
stock_location = 'stock_location',
stocktake = 'stocktake'
stocktake = 'stocktake',
users = 'users'
}
/*