SharedEntity.SharePermissions methods not work in ScriptRunner

Hi here,

I would like remove private (no one can see it) filters from inactive users. For check filter is private I tried use https://docs.atlassian.com/software/jira/docs/api/7.1.1/com/atlassian/jira/sharing/SharedEntity.SharePermissions.html#isPrivate--

My code:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.search.CachingSearchRequestStore

def csrs = ComponentAccessor.getComponent(CachingSearchRequestStore.class)
def string = "Filter: " + csrs.getSearchRequest(10704L) +"<br/>"
string += "Filter perm is empty? : " + csrs.getSearchRequest(10704L).getPermissions().isEmpty() +"<br/>"
string += "Filter perm is private? : " + csrs.getSearchRequest(10704L).getPermissions().isPrivate() +"<br/>"
string += "Filter perm is global? : " + csrs.getSearchRequest(10704L).getPermissions().isGlobal()  +"<br/>"

But the result is always the same, no matter what is really set in the filter permission in UI:

Filter: Search Request: name: testC query = {project = "ALFA"}
Filter perm is empty? : true
Filter perm is private? : true
Filter perm is global? : false

Could You please help me? Can I check private filter trough methods or only direct from DB?