-
Notifications
You must be signed in to change notification settings - Fork 470
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 12678 fixing workflow roles permission issue #13526
Issue 12678 fixing workflow roles permission issue #13526
Conversation
.doesRoleHavePermission(action, PermissionAPI.PERMISSION_USE, | ||
anyWhoCanViewContent)) { | ||
if (APILocator.getPermissionAPI() | ||
if (permissionAPI |
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.
.doesRoleHavePermission(action, PermissionAPI.PERMISSION_USE, | ||
anyWhoCanPublishContent)) { | ||
if (APILocator.getPermissionAPI().doesUserHavePermission(permissionable, | ||
if (permissionAPI.doesUserHavePermission(permissionable, |
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.
.doesRoleHavePermission(action, PermissionAPI.PERMISSION_USE, | ||
anyWhoCanEditContent)) { | ||
if (APILocator.getPermissionAPI().doesUserHavePermission(permissionable, | ||
if (permissionAPI.doesUserHavePermission(permissionable, |
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.
.doesRoleHavePermission(action, PermissionAPI.PERMISSION_USE, | ||
anyWhoCanEditPermisionsContent)) { | ||
if (APILocator.getPermissionAPI().doesUserHavePermission(permissionable, | ||
if (permissionAPI.doesUserHavePermission(permissionable, |
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.
* @throws DotDataException | ||
* @throws DotSecurityException | ||
*/ | ||
public WorkflowAction findActionRespectingPermissions(String actionId, String stepId, Permissionable permissionable, User user) throws DotDataException, DotSecurityException; |
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.
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.
Wouldn't be bad to add an integration test for this new API method
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.
test included
* @throws DotDataException | ||
* @throws DotSecurityException | ||
*/ | ||
public WorkflowAction findActionRespectingPermissions(String id, Permissionable permissionable, User user) throws DotDataException, DotSecurityException; |
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.
SonarQube analysis reported 9 issues Watch the comments in this conversation to review them. 3 extra issuesNote: The following issues were found on lines that were not modified in the pull request. Because these issues can't be reported as line comments, they are summarized here:
|
} catch(Exception e){ | ||
|
||
|
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.
@oswaldogallango should we remove the try?, not empty catch should exist, if the try is required and no logic in the catch should be done please add a Log.error
but most likely the try should be remove.
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.
@jgambarios the try and catch can not be removed because, if the user doesn't have permission to execute that action the method is going to throw an exception but you still want to continue doing the save, but if the user have permission you just execute the fireworkflow action according to the if that is below
If the user does not have permission to the action, then the save should fail. |
No description provided.