Search in sources :

Example 16 with PermissionHelper

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)));
}
Also used : ClassNotFoundRuntimeException(org.codelibs.core.exception.ClassNotFoundRuntimeException) Constants(org.codelibs.fess.Constants) SortBuilders(org.elasticsearch.search.sort.SortBuilders) Enumeration(java.util.Enumeration) Date(java.util.Date) JobConcurrentExec(org.lastaflute.job.subsidiary.JobConcurrentExec) OptionalThing(org.dbflute.optional.OptionalThing) Pair(org.codelibs.core.misc.Pair) PermissionHelper(org.codelibs.fess.helper.PermissionHelper) IntegerTypeValidator(org.lastaflute.web.validation.theme.typed.IntegerTypeValidator) LaRequestUtil(org.lastaflute.web.util.LaRequestUtil) LongTypeValidator(org.lastaflute.web.validation.theme.typed.LongTypeValidator) ArrayList(java.util.ArrayList) HashSet(java.util.HashSet) BasicAttribute(javax.naming.directory.BasicAttribute) FessUserBean(org.codelibs.fess.mylasta.action.FessUserBean) Attribute(javax.naming.directory.Attribute) StreamUtil.split(org.codelibs.core.stream.StreamUtil.split) Locale(java.util.Locale) Map(java.util.Map) PrunedTag(org.codelibs.fess.util.PrunedTag) HtmlNext(org.lastaflute.web.response.next.HtmlNext) SortBuilder(org.elasticsearch.search.sort.SortBuilder) HttpSession(javax.servlet.http.HttpSession) LaJob(org.lastaflute.job.LaJob) StreamUtil.stream(org.codelibs.core.stream.StreamUtil.stream) FloatTypeValidator(org.lastaflute.web.validation.theme.typed.FloatTypeValidator) ConcurrentHashMap(java.util.concurrent.ConcurrentHashMap) StringUtil(org.codelibs.core.lang.StringUtil) Set(java.util.Set) RequiredValidator(org.lastaflute.web.validation.RequiredValidator) Tuple3(org.codelibs.core.misc.Tuple3) Collectors(java.util.stream.Collectors) List(java.util.List) ComponentUtil(org.codelibs.fess.util.ComponentUtil) SearchRequestBuilder(org.elasticsearch.action.search.SearchRequestBuilder) SortOrder(org.elasticsearch.search.sort.SortOrder) Pattern(java.util.regex.Pattern) Collections(java.util.Collections) DoubleTypeValidator(org.lastaflute.web.validation.theme.typed.DoubleTypeValidator) FessFunctions(org.codelibs.fess.taglib.FessFunctions) PermissionHelper(org.codelibs.fess.helper.PermissionHelper) ArrayList(java.util.ArrayList) List(java.util.List)

Aggregations

Collectors (java.util.stream.Collectors)16 StringUtil (org.codelibs.core.lang.StringUtil)16 StreamUtil.stream (org.codelibs.core.stream.StreamUtil.stream)16 PermissionHelper (org.codelibs.fess.helper.PermissionHelper)16 ComponentUtil (org.codelibs.fess.util.ComponentUtil)16 Resource (javax.annotation.Resource)14 Constants (org.codelibs.fess.Constants)14 StreamUtil.split (org.codelibs.core.stream.StreamUtil.split)13 CrudMode (org.codelibs.fess.app.web.CrudMode)12 Execute (org.lastaflute.web.Execute)12 OptionalEntity (org.dbflute.optional.OptionalEntity)11 OptionalThing (org.dbflute.optional.OptionalThing)11 FessAdminAction (org.codelibs.fess.app.web.base.FessAdminAction)9 SystemHelper (org.codelibs.fess.helper.SystemHelper)9 RenderDataUtil (org.codelibs.fess.util.RenderDataUtil)9 HtmlResponse (org.lastaflute.web.response.HtmlResponse)9 RenderData (org.lastaflute.web.response.render.RenderData)9 ActionRuntime (org.lastaflute.web.ruts.process.ActionRuntime)9 List (java.util.List)8 Stream (java.util.stream.Stream)8