Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Set permission scheme in Java

Chris Steenwyk
Contributor
April 15, 2021

I am trying to set the permission scheme of a project. I have a permission scheme named "Test".

 

This code passes, but the permission scheme remains "Default Software Scheme". Ideas?

 

public void SetPermissionScheme(Project project) 
{

log.info("Setting project permission scheme");
PermissionSchemeManager permissionSchemeManager = ComponentAccessor.getPermissionSchemeManager();
permissionSchemeManager.removeSchemesFromProject( project );
Scheme permissionScheme = permissionSchemeManager.getSchemeObject("Test");
permissionSchemeManager.addSchemeToProject(project, permissionScheme);
}

This is what the audit log looks like for the project:

image.jpg So the permission scheme is set, then removed for some reason?

1 answer

0 votes
Martin Bayer _MoroSystems_ s_r_o__
Community Champion
April 15, 2021

Hi @Chris Steenwyk I never used this manager but I have few ideas

Can you try to add some logging and share the log pls?

Chris Steenwyk
Contributor
April 20, 2021

So I added logging . There are no errors reported during the operation. I also removed the "removeSchemesFromProject" call without affecting the end result.

Is there another way to set the permission scheme?

Martin Bayer _MoroSystems_ s_r_o__
Community Champion
April 21, 2021

What is the result of following code?

Scheme permissionScheme = permissionSchemeManager.getSchemeObject("Test"); 
log.error(permissionScheme) 
TimG1367 March 21, 2025

I have exactely the same problem, in the audit logs I can see that the scheme is set correctely by my plugin, but then is overwritten to the standard scheme.

Does anyone have the solution now ?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.13.5
TAGS
AUG Leaders

Atlassian Community Events