Closed Eldies closed 1 month ago
[!IMPORTANT]
Review skipped
Auto incremental reviews are disabled on this repository.
Please check the settings in the CodeRabbit UI or the
.coderabbit.yaml
file in this repository. To trigger a single review, invoke the@coderabbitai review
command.You can disable this status message by setting the
reviews.review_status
tofalse
in the CodeRabbit configuration file.
The changes introduce a new user role, analytics
, to the CVAT system, affecting user permissions and access control. Modifications are made across several files to accommodate this role, including updates to user group definitions, access checks, and role management structures. The overall aim is to enhance the application's capability to manage user permissions more effectively and streamline group assignments for staff members.
File | Change Summary |
---|---|
cvat-core/src/user.ts |
Expanded groups property in the User class to include the new 'analytics' role. |
cvat-ui/src/components/header/header.tsx |
Updated conditional rendering logic in HeaderComponent to show the "Analytics" button for users in the 'analytics' group, in addition to superusers. |
cvat/apps/iam/rules/utils.rego |
Introduced ANALYTICS privilege level with a priority of 70 and added is_analytics function for checking user privileges. |
cvat/apps/iam/signals.py |
Added logic in create_user function to automatically assign staff members to the IAM_ANALYTICS_ROLE group. |
cvat/apps/log_viewer/rules/analytics.rego |
Enhanced permission logic in the allow rule to include users with analytics permissions. |
cvat/settings/base.py |
Introduced IAM_ANALYTICS_ROLE and updated IAM_ROLES list to include this new role, adjusting the hierarchy. |
sequenceDiagram
participant User
participant HeaderComponent
participant IAM
participant RoleManagement
User->>HeaderComponent: Request to view header
HeaderComponent->>IAM: Check user groups
IAM-->>HeaderComponent: Return user groups (includes analytics)
HeaderComponent->>User: Render header with "Analytics" button visible
π° Hopping through the code, what a delightful sight,
New roles and permissions, everything feels right!
From users to analytics, we spread our cheer,
With buttons and groups, the path is clear!
A world of access, so bright and anew,
Celebrating the changes, let's leap and pursue! π
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?
Attention: Patch coverage is 33.33333%
with 2 lines
in your changes missing coverage. Please review.
Project coverage is 83.57%. Comparing base (
4aa2a4e
) to head (9144012
).
@nmanovic I am not sure I correctly understood how it should work. In this PR, every new or updated user who is staff will be added to the "analytics" group. Already existing staff users will not be added to the group and will not get access to analytics, unless someone updates them. Please confirm - is this behaviour satisfactory?
Issues
0 New issues
0 Accepted issues
Measures
0 Security Hotspots
0.0% Coverage on New Code
0.0% Duplication on New Code
dropped in favor of https://github.com/cvat-ai/cvat/pull/8509
Motivation and context
We need to be able to give access to analytics without assigning people to "admin" group
How has this been tested?
Checklist
develop
branchLicense
Summary by CodeRabbit
ANALYTICS
, for refined user access control.