-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Batch edit access level for editor role #7464
Batch edit access level for editor role #7464
Conversation
* | ||
* @param userSession | ||
*/ | ||
private void checkUserProfileToBatchEditMetadata(UserSession userSession) { |
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.
This code is repeated in other places. Also there is similar code for other features (checkUserProfileToDeletePublishedMetadata
, checkUserProfileToImportMetadata
).
Could be good to refactor all these methods in a utility class in the services
module: UserProfileUtil
or similar with these methods.
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.
For now in this pull request can be refactor only checkUserProfileToBatchEditMetadata
, that should be fine also.
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.
i am good with refactoring to a common place. I will make the code change. We should make a common name for it (i.e checkUserProfileLevel)
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.
I did a total refactoring including checkUserProfileToDeletePublishedMetadata and checkUserProfileToImportMetadata to the more general util method. Please take a look
@@ -0,0 +1,35 @@ | |||
package org.fao.geonet.api; |
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.
you need to include general license in the top of the file.
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.
I see a UserUtil
, apologies as didn't see that initially. Maybe these methods can be added in that class instead of a new one.
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.
No problem, its a small refactoring.
Co-authored-by: Jose García <josegar74@gmail.com>
* Batch edit access level for editor role * comment description fix * refactor user profile configuration level check to util class * Move to UserUtil for profile configuration level check * Update core/src/main/java/org/fao/geonet/util/UserUtil.java Co-authored-by: Jose García <josegar74@gmail.com> --------- Co-authored-by: Jose García <josegar74@gmail.com>
* Batch edit access level for editor role * comment description fix * refactor user profile configuration level check to util class * Move to UserUtil for profile configuration level check * Update core/src/main/java/org/fao/geonet/util/UserUtil.java Co-authored-by: Jose García <josegar74@gmail.com> --------- Co-authored-by: Jose García <josegar74@gmail.com>
This PR is some bug found related to the previous Batch Editing Access level feature #7238
This button needs access level control as well.
I also put some measure in /batchconfiguration API similar to the
core-geonetwork/services/src/main/java/org/fao/geonet/api/records/editing/BatchEditsApi.java
Lines 193 to 194 in b417ead