-
Notifications
You must be signed in to change notification settings - Fork 467
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
Issue 28579 add way to bulk reset permissions #30352
Merged
Merged
+208
−89
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
erickgonzalez
requested changes
Oct 16, 2024
...S/src/main/java/com/dotmarketing/portlets/workflows/actionlet/ResetPermissionsActionlet.java
Show resolved
Hide resolved
...-integration/src/test/java/com/dotmarketing/portlets/workflows/business/WorkflowAPITest.java
Outdated
Show resolved
Hide resolved
...tegration/src/test/java/com/dotcms/rest/api/v1/workflow/WorkflowResourceIntegrationTest.java
Outdated
Show resolved
Hide resolved
…://github.com/dotCMS/core into issue-28579-add-way-to-bulk-reset-permissions
about to review this |
jdotcms
reviewed
Oct 16, 2024
...S/src/main/java/com/dotmarketing/portlets/workflows/actionlet/ResetPermissionsActionlet.java
Outdated
Show resolved
Hide resolved
jdotcms
reviewed
Oct 16, 2024
...S/src/main/java/com/dotmarketing/portlets/workflows/actionlet/ResetPermissionsActionlet.java
Outdated
Show resolved
Hide resolved
jdotcms
reviewed
Oct 16, 2024
dotCMS/src/main/java/com/dotmarketing/business/ajax/PermissionAjax.java
Outdated
Show resolved
Hide resolved
erickgonzalez
approved these changes
Oct 17, 2024
Quality Gate passedIssues Measures |
jdotcms
approved these changes
Oct 17, 2024
spbolton
pushed a commit
that referenced
this pull request
Nov 11, 2024
New feature added to allow bulk reset permissions. The approach taken was to create a new actionlet, this way now the user can create a step and add a sub-action to it called "Reset Permissions". This subaction doesn't need any parameter, and to execute it the user firing the action should have edit permissions on the contentlet. To be able to fire this action you should add it to a step as a sub-action: https://github.com/user-attachments/assets/1955851c-2f93-4c00-b007-d7c7bf389901 Then (and after adding any setting that you want) you can fire the step. Here I show a case of an unlimited user, such as admin, in where I reset the permission of several contentlets, first I show that the contentlets have had their permissions modified. **Case admin user** https://github.com/user-attachments/assets/d915a00d-89e9-47cd-95a6-9c0c2971e5d3 Then there is the case in where the user doesn't have the permissions to edit permissions in some of the contentlets, so here I select some contentlets and show that they have only publish permissions to the Publisher role and some others that have the edit permissions, these last contentlets are going to be the ones that executes the action successfully. **Case limited user** https://github.com/user-attachments/assets/4269bec3-7d2e-41ea-8c21-8a41ebc0b2d5 **Note***: Apart from the issue, an error was found and fixed. When firing some action, **if the first contentlet throws a fail**, the flow doesn't keep trying to execute the action in the remaining contentlets because it was throwing an exception unrelated to the action itself, here I show how was the error happening with another subaction (Unlock) https://github.com/user-attachments/assets/8cde0540-c36b-4d1f-b6cb-4aa33434a6c5 --------- Co-authored-by: erickgonzalez <[email protected]>
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.
New feature added to allow bulk reset permissions. The approach taken was to create a new actionlet, this way now the user can create a step and add a sub-action to it called "Reset Permissions". This subaction doesn't need any parameter, and to execute it the user firing the action should have edit permissions on the contentlet.
To be able to fire this action you should add it to a step as a sub-action:
How.to.add.the.subaction.mov
Then (and after adding any setting that you want) you can fire the step.
Here I show a case of an unlimited user, such as admin, in where I reset the permission of several contentlets, first I show that the contentlets have had their permissions modified.
Case admin user
admin.case.mov
Then there is the case in where the user doesn't have the permissions to edit permissions in some of the contentlets, so here I select some contentlets and show that they have only publish permissions to the Publisher role and some others that have the edit permissions, these last contentlets are going to be the ones that executes the action successfully.
Case limited user
limited.user.case.mov
Note*: Apart from the issue, an error was found and fixed. When firing some action, if the first contentlet throws a fail, the flow doesn't keep trying to execute the action in the remaining contentlets because it was throwing an exception unrelated to the action itself, here I show how was the error happening with another subaction (Unlock)
fail.error.mov
This PR fixes: #28579