Forums

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

Identifying the current user

Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 9, 2023

Hi,

I am looking for script in ScriptRunner Listeners to identify whether the current user is the Space Admin or not.

There already is the command to check whether the user is Confluence Adminstrator:

permissionManager.isConfluenceAdministrator(currentUser);

Is there similar one to check for Space Admin?

Thanks,
Vamsi

1 answer

1 accepted

0 votes
Answer accepted
Florian Bonniec
Community Champion
January 9, 2023

Hi @Vamsi Kandala 

 

Have you try the following line of code ?

permissionManager.hasPermission(currentUser, Permission.ADMINISTER, space);

 

You have to import 

com.atlassian.confluence.security.Permission
You also have to set space variable with a space object.
Regards
Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 9, 2023

Hi @Florian Bonniec

Thank you.  Yes, that works.

Regards,
Vamsi

Suggest an answer

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

Atlassian Community Events