use of hudson.security.GlobalMatrixAuthorizationStrategy in project blueocean-plugin by jenkinsci.
the class GithubServerTest method createUser.
@Before
public void createUser() throws Exception {
HudsonPrivateSecurityRealm realm = new HudsonPrivateSecurityRealm(true);
User writeUser = realm.createAccount("write_user", "pale_ale");
j.jenkins.setSecurityRealm(realm);
GlobalMatrixAuthorizationStrategy as = new GlobalMatrixAuthorizationStrategy();
j.jenkins.setAuthorizationStrategy(as);
as.add(Jenkins.READ, (String) Jenkins.ANONYMOUS.getPrincipal());
{
as.add(Item.BUILD, writeUser.getId());
as.add(Item.CREATE, writeUser.getId());
as.add(Item.CONFIGURE, writeUser.getId());
}
token = getJwtToken(j.jenkins, "write_user", "pale_ale");
this.crumb = getCrumb(j.jenkins);
}
Aggregations