Skip to content

Commit

Permalink
#1734 Minor code layout improvements.
Browse files Browse the repository at this point in the history
  • Loading branch information
01es committed Dec 2, 2021
1 parent 121d149 commit 9006a77
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package ua.com.fielden.platform.menu.validators;

import static java.lang.String.format;
import static ua.com.fielden.platform.error.Result.failure;
import static ua.com.fielden.platform.error.Result.successful;

import java.lang.annotation.Annotation;
import java.util.Set;
Expand All @@ -23,7 +25,7 @@ public class UserAsConfigurationOwnerValidator implements IBeforeChangeEventHand

@Override
public Result handle(final MetaProperty<User> property, final User newValue, final Set<Annotation> mutatorAnnotations) {
return newValue.isBase() ? Result.failure(format(ERR_USER_IS_A_BASE_USER, newValue)) : Result.successful(newValue);
return newValue.isBase() ? failure(format(ERR_USER_IS_A_BASE_USER, newValue)) : successful(newValue);
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
*/
public interface IUser extends IEntityDao<User> {

static final IFetchProvider<User> FETCH_PROVIDER = EntityUtils.fetch(User.class)
.with("key", EMAIL, ACTIVE)
.with("base", "basedOnUser.base", "roles");

/**
* Returns users with roles.
*
Expand Down Expand Up @@ -139,15 +143,11 @@ public interface IUser extends IEntityDao<User> {
User findUser(String username);

/**
* Returns all active based-on users
* Returns all active based-on users.
*
* @param baseUser
* @return
*/
Set<User> findBasedOnUsers(final User baseUser, final fetch<User> userFetch);

static final IFetchProvider<User> FETCH_PROVIDER = EntityUtils.fetch(User.class)
.with("key", EMAIL, ACTIVE)
.with("base", "basedOnUser.base", "roles");

}

0 comments on commit 9006a77

Please sign in to comment.