use of org.codelibs.fess.helper.PermissionHelper in project fess by codelibs.
the class FessProp method isValidSearchLogPermissions.
public default default boolean isValidSearchLogPermissions(final String[] permissions) {
if (permissions == null) {
return false;
}
@SuppressWarnings("unchecked") List<String> validPermissionList = (List<String>) propMap.get(SUGGEST_SEARCH_LOG_PERMISSIONS);
if (validPermissionList == null) {
final PermissionHelper permissionHelper = ComponentUtil.getPermissionHelper();
validPermissionList = split(getSuggestSearchLogPermissions(), ",").get(stream -> stream.map(s -> permissionHelper.encode(s)).filter(StringUtil::isNotBlank).collect(Collectors.toList()));
propMap.put(SUGGEST_SEARCH_LOG_PERMISSIONS, validPermissionList);
}
final List<String> list = validPermissionList;
return stream(permissions).get(stream -> stream.allMatch(v -> list.contains(v)));
}
Aggregations