Error modifier method

Hi

I am trying to apply permission in a site on this way:

contentService.applyPermissions(ApplyContentPermissionsParams.create().contentId(demoContent.getId()).modifier(PrincipalKey.ofAnonymous()).build());

But I get this error:
cannot find symbol : method modifier(PrincipalKey)

I am using enonic xp 6.2.0. Do you know how I can solve this?

The modifier parameter was removed and it is now taken from the current context. So you don’t need to call it.

Just do something like this:

contentService.applyPermissions(ApplyContentPermissionsParams.create().
    contentId(demoContent.getId()).build());

Thanks aro. It works.