Skip to content
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

Merged
merged 5 commits into from
Nov 10, 2023

Conversation

wangf1122
Copy link
Collaborator

This PR is some bug found related to the previous Batch Editing Access level feature #7238

This button needs access level control as well.
image

I also put some measure in /batchconfiguration API similar to the

ServiceContext serviceContext = ApiUtils.createServiceContext(request);
checkUserProfileToBatchEditMetadata(serviceContext.getUserSession());

@wangf1122 wangf1122 marked this pull request as ready for review October 30, 2023 20:27
*
* @param userSession
*/
private void checkUserProfileToBatchEditMetadata(UserSession userSession) {
Copy link
Member

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.

Copy link
Member

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.

Copy link
Collaborator Author

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)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josegar74

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;
Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@josegar74

No problem, its a small refactoring.

Co-authored-by: Jose García <josegar74@gmail.com>
@ianwallen ianwallen merged commit e62739c into geonetwork:main Nov 10, 2023
6 checks passed
ianwallen pushed a commit that referenced this pull request Nov 10, 2023
* 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>
ianwallen pushed a commit that referenced this pull request Nov 10, 2023
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants