package com.onaro.util.jfc; import com.onaro.sanscreen.client.login.UserUtils; /** * An action restricted to principals (logged-in user) with an Admin or User role. * The action is disabled if the principal only has a Guest role. */ public interface RoleRestrictedAction { /** * Indicates if action is restricted (not allowed) for the current user's role. * Default is that only non-Guest roles are allowed to perform action. * @return {@code true} if action should be disabled */ public default boolean isRestricted() { return UserUtils.getInstance().isCurrentUserGuest(); } }