class PermissionSpec implements Serializable {
        private static final long serialVersionUID = 7188197046015343251L;
        private String id;
        private List<String> actions;
    }

    public boolean isGranted(Authentication auth) {
        return createFilter().test(auth);
    }

    public Predicate<Authentication> createFilter() {<FILL_FUNCTION_BODY>

        RoleSpec role = this.role;
        List<PermissionSpec> permissions = this.permissions;
        List<Predicate<Authentication>> all = new ArrayList<>();

        if (null != role && role.getIdList() != null) {
            all.add(auth -> auth.hasDimension(DefaultDimensionType.role.getId(), role.getIdList()));
        }

        if (null != permissions) {
            for (PermissionSpec permission : permissions) {
                all.add(auth -> auth.hasPermission(permission.getId(), permission.getActions()));
            }
        }

        Predicate<Authentication> temp = null;
        for (Predicate<Authentication> predicate : all) {
            if (temp == null) {
                temp = predicate;
            } else {
                temp = temp.and(predicate);
            }
        }
        return temp == null ? auth -> true : temp;
    
<no_super_class>