class IsAdministrableObjectPermissionArgumentVoter extends BasicObjectPermissionArgumentVoter {

    @Override
    protected boolean isPermitted(Authentication authentication, ObjectPermission objectPermission, Object object) {
        SidRetrievalStrategy sidStrategy = new JasperServerSidRetrievalStrategyImpl();

        Acl acl;
        try {
            acl = resourcesAclService.readAclById(getSecureObject(authentication, objectPermission), sidStrategy.getSids(authentication));
        } catch (JSException e) {
            // in some cases we are trying to reach not reachable resource, this will throw error
            acl=null;
        }
        List<Permission> requiredPermissionsList = new ArrayList<Permission>();
        requiredPermissionsList.add(JasperServerPermission.ADMINISTRATION);
        if (acl!=null && acl.isGranted(requiredPermissionsList,sidStrategy.getSids(authentication),false)) {
            return true;
        }

        return false;
    }

}