Cannot find matching method Scriptrunner Confluence

oib July 23, 2018

Hi all,

I'm trying to create a flag that shows on every page if it's in a public or private space due security. I'm using the Adaptavist Scriptrunner and would like to achieve this with some Groovy Scripting, but somehow it keeps giving me errors. 

import com.atlassian.confluence.pages.Page
import com.atlassian.confluence.security.Permission
import com.atlassian.confluence.security.PermissionManager
import com.atlassian.confluence.security.SpacePermissionManager
import com.atlassian.confluence.user.ConfluenceUser
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.confluence.spaces.Space

def space = context.space as Space

if (space) {
def spaceManager = ComponentLocator.getComponent(SpacePermissionManager)
return spaceManager.groupHasPermission(Permission.VIEW, space, "confluence-users")
}
else {
return false
}  

 I already tried with different permissions, but the same errors keeps popping up:

Cannot find matching method
com.atlassian.confluence.security.DefaultSpacePermissionManagergroupHasPermission
Please check if the declared type is right and if the method exists.

What is going wrong?

Thank you 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events