-
-
Notifications
You must be signed in to change notification settings - Fork 185
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(projectHistoryLogs): record logs for cloned permissions TASK-944 #5302
Merged
Conversation
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
rgraber
changed the base branch from
main
to
rsgraber/TASK-944-permissions-better
November 26, 2024 21:01
rgraber
force-pushed
the
rsgraber/TASK-944-cloned-perms
branch
from
November 27, 2024 22:16
77c019d
to
6fc38bd
Compare
Guitlle
approved these changes
Dec 2, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. It's simpler than what I was going to do
rgraber
added a commit
that referenced
this pull request
Dec 3, 2024
…#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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🗒️ Checklist
<type>(<scope>)<!>: <title> TASK-1234
frontend
orbackend
unless it's global📣 Summary
Record logs when permissions are cloned from one project to another.
👀 Preview steps
Feature/no-change template:
💭 Notes
Uses the AuditLoggedModelViewSet base class