-
-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(projectHistoryLogs): record logs for cloned permissions TASK-944 (…
…#5302) ### 📣 Summary Record logs when permissions are cloned from one project to another. ### 👀 Preview steps Feature/no-change template: 1. ℹ️ have an account and at least 2 projects 2. From a terminal, run ``` curl -X PATCH -H 'Authorization: Token <your token>' -H 'Content-type: application/json' localhost/api/v2/assets/<project_1_uid>/permission_assignments/clone/ -d '{"clone_from": "<project_2_uid>"}' ``` 4. Go to `localhost/api/v2/audit-logs/?](http://localhost/api/v2/audit-logs/?q=log_type:project-history AND metadata__asset_uid:<project_1_uid>&format=json 5. 🟢 There should be a new project history log that looks like ``` app_label: "kpi", model_name: "asset", user: "http://localhost/api/v2/users/<user>/?format=json", user_uid: "<user_uid>", username: "<username>", action: "clone-permissions", metadata: { source: "curl (Other)" asset_uid: "<project_1_uid>" ip_address: "172.18.0.1" cloned_from: "<project_2_uid>" log_subtype: "permission" }, date_created: "2024-12-02T15:21:20Z", log_type: "project-history", ``` ### 💭 Notes Uses the AuditLoggedModelViewSet base class
- Loading branch information
Showing
4 changed files
with
39 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters