Hello, everyone
I added new custom web item via sciptrunner in jira. It should be shown only when current user didn't have permission to browse project.
My condition (is not work):
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.security.plugin.ProjectPermissionKey
import com.atlassian.jira.project.Project
def currentUser = ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser()
Project project = jiraHelper.project
def permissionManager = ComponentAccessor.getPermissionManager()
ProjectPermissionKey browse_projects = new ProjectPermissionKey("BROWSE_PROJECTS")
def hasPerm = permissionManager.hasPermission(browse_projects, project, currentUser)
(!hasPerm)
I guess the problem is jiraHelper return the last project that user used/browsed when user has not permission to browse current project .
Is it any other solution I can use in the condition to define project correctly?