Enable referencing the current user when evaluating permission constraints #9074
Labels
status: accepted
This issue has been accepted for implementation
type: feature
Introduction of new functionality to the application
Milestone
NetBox version
v3.2.0
Feature type
New functionality
Proposed functionality
When assigning user and group permissions in NetBox, an administrator can attach certain constraints to effect object-level permissions. These constraints can evaluate object attributes but are currently limited to referencing static values.
This FR proposes a mechanism to allow constraints to reference the current user when evaluating rules. For example, the following constraint might be used to permit a user to delete only his or her own journal entries:
(I'm open to ideas about the preferred variable structure;
$USER
seemed like a reasonable placeholder.)I still need to look more into the implementation details, but it seems reasonable to assume that the current user will always be available in the context of permissions evaluation.
Use case
This would allow for more dynamic constraint definitions, and avoid the need to define unique rules per user.
Database changes
No response
External dependencies
No response
The text was updated successfully, but these errors were encountered: