1

Is it possible to grant a role the ability to view/get the users list? I ask this because I am working on a C# application that lets developpers automatically create JIRA issues (using the SOAP api) from within the program, and I'd like to be able to let them select the assignee from a dropdown list. However, the account I connect to JIRA with needs to be an administrator, and I do not want to have an administrator account's credentials in plain text inside the codebase, since it is open to everyone.

This is what I am doing:

JiraSoapServiceClient jira = new JiraSoapServiceClient();
string token = jira.login("non_admin_account", "password");

...

//This call throws an exception saying the account needs administrative rights
var projectRoleActors = jira.getProjectRoleActors(token, projectRole,
                                                  jira.getProjectByKey(token, "EX"));

If I could give "non_admin_account" some kind of permission to grab the users list that would be perfect.. but I'm not sure that's possible.

Any solutions?

4

2 回答 2

1

Give your use Project Administration permission instead of JIRA administration. See the method hasProjectRolePermission in DefaultProjectRoleService

于 2012-08-03T18:09:34.163 回答
0

One solution to your question might be to create two users, one with project admin permissions, and another as a normal user:

  • Use the admin user to get the list of users - create a CLI program, or use the remote SOAP C# program to get the list of users and store them in a text file. Make sure that the program isn't visible to the other users (for example, put it on your Jira server). You can either run this using the cron/scheduler every 5 minutes or run it trough the other program.
  • Use the other account for everything else in your C# program, let it read the list of users from the first program.
于 2012-08-05T08:37:14.360 回答