You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
When my Bamboo Spec creates a build plan the permissions are (what I presume to be) default instead of what I set in code.
Relevant parts of my code:
public static void main(String[] args) {
// ... snip ...
Plan plan = planSpec.createPlan();
bambooServer.publish(plan);
PlanPermissions planPermission = planSpec.createPlanPermission();
bambooServer.publish(planPermission);
}
Plan createPlan() {
return new Plan(project(), PLAN_NAME, PLAN_KEY)
.description(PLAN_DESCRIPTION)
.linkedRepositories(LINKED_REPOSITORY_NAME)
// ... snip ...
}
Project project() {
return new Project()
.key(PROJECT_KEY);
}
PlanPermissions createPlanPermission() {
Permissions permissions = new Permissions()
.groupPermissions("test-dev", PermissionType.VIEW, PermissionType.CLONE, PermissionType.BUILD, PermissionType.EDIT)
.groupPermissions("test-admin", PermissionType.VIEW, PermissionType.CLONE, PermissionType.BUILD, PermissionType.EDIT, PermissionType.ADMIN)
.loggedInUserPermissions(PermissionType.VIEW)
.anonymousUserPermissionView();
return new PlanPermissions(new PlanIdentifier(PROJECT_KEY, PLAN_KEY))
.permissions(permissions);
}
Result of "View plan as Java Specs":
public PlanPermissions planPermission() {
final PlanPermissions planPermission = new PlanPermissions(
new PlanIdentifier(PROJECT_KEY, PLAN_KEY))
.permissions(new Permissions()
.loggedInUserPermissions(PermissionType.VIEW)
.anonymousUserPermissionView());
return planPermission;
}
I am using Bamboo 7.0.4 connected to Bitbucket Server 6.6.1.
The very first successful scan of the linked repository worked fine. I was able to access the edit screen, view the generated Java Spec, etc.
Before pushing my next change (containing minor formatting), I deleted the build plan. After the next push, when the build plan was recreated, the permissions were missing. Even after deleting again and reverting my code, I can't get the permissions to work.
I had to set Project-level plan permissions before I could access the edit screen to get the above code snippet.
It appears that setting Access all projects on the linked repository fixed this.
Linked Repository -> Bamboo Specs -> Access -> Access all projects
I ticked this to resolve a different issue (plan didn't have access to create a Deployment Project), and my access levels started applying.
Unfortunately this setting appears to require Global Admin, so I'm not sure if it's appropriate for all repos to have this.
Accepting my own answer, but would love some insight into whether this is a good idea, or why it may have worked initially.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.