public Map<ResourceDescriptor, Set<ResourceAccessType>> getOwnResourcesAccessForChainedSchemaRichApplication(
            Set<ResourceDescriptor> resources, ProxyContext context) {
        if (context.getDeployment() instanceof Application application && application.hasApplicationTypeSchemaId()) {
            List<ResourceDescriptor> applicationFiles = ApplicationTypeSchemaUtils.getFiles(context.getConfig(), application, context.getProxy().getEncryptionService(),
                    context.getProxy().getResourceService());
            String location = BucketBuilder.buildInitiatorBucket(context);
            Map<ResourceDescriptor, Set<ResourceAccessType>> result = new HashMap<>();
            for (ResourceDescriptor resource : resources) {
                if (resource.getBucketLocation().equals(location) && applicationFiles.contains(resource)) {
                    result.put(resource, ResourceAccessType.READ_ONLY);
                }
            }
            return result;
        } else {
            return Map.of();
        }
    }
Checks if the context represents an application rather than a user.
Applications should have access to their own published system resources.

@param context The proxy context
@return true if this appears to be an application context, false for user contexts
server/src/main/java/com/epam/aidial/core/server/security/AccessService.java