Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No signature of method getRoleMap applicable for argument types string #113

Open
fsadykov opened this issue Apr 3, 2020 · 1 comment
Open

Comments

@fsadykov
Copy link

fsadykov commented Apr 3, 2020

Hello guys,

I am trying to get list of people from the admin role using AuthorizationStrategy.

I have posted a related question on StackOverflow LINK

When I run this code in my Jenkins script console it's complaining about authStrategy.GLOBAL

def roles = authStrategy.getRoleMap(authStrategy.GLOBAL).grantedRoles*.key.name.sort() + authStrategy.getRoleMap(authStrategy.PROJECT).grantedRoles*.key.name.sort()

Versions

  • Jenkins: 2.222.1
  • RoleBasedAuthorizationStrategy: 2.16

Error Output

groovy.lang.MissingMethodException: No signature of method: com.michelin.cio.hudson.plugins.rolestrategy.RoleBasedAuthorizationStrategy.getRoleMap() is applicable for argument types: (java.lang.String) values: [globalRoles]
@Fran-Rg
Copy link

Fran-Rg commented Sep 16, 2020

Was able to fix it with:

import com.synopsys.arc.jenkins.plugins.rolestrategy.RoleType;

->line 52

//   def roles = authStrategy.getRoleMap(authStrategy.GLOBAL).grantedRoles*.key.name.sort() + authStrategy.getRoleMap(authStrategy.PROJECT).grantedRoles*.key.name.sort()
   def roles = authStrategy.getRoleMap(RoleType.Global).grantedRoles*.key.name.sort() + authStrategy.getRoleMap(RoleType.Project).grantedRoles*.key.name.sort()

jtnord pushed a commit to jtnord/jenkins-scripts that referenced this issue Oct 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants