use of io.crnk.security.ResourcePermissionInformation in project crnk-framework by crnk-project.
the class SecurityRepositoryFilter method filterMeta.
@Override
public <T> MetaInformation filterMeta(RepositoryFilterContext context, Iterable<T> resources, RepositoryMetaFilterChain chain) {
MetaInformation metaInformation = chain.doFilter(context, resources);
if (metaInformation instanceof ResourcePermissionInformation) {
ResourcePermissionInformation permissionInformation = (ResourcePermissionInformation) metaInformation;
QueryAdapter queryAdapter = context.getRequest().getQueryAdapter();
Class<?> resourceClass = queryAdapter.getResourceInformation().getResourceClass();
permissionInformation.setResourcePermission(module.getResourcePermission(resourceClass));
}
return metaInformation;
}
Aggregations