Set Permissions for webwork1


according to this example

i tried to make one of my webwork1-modules only available for admin-users.

<webwork1 key="myAdminWebwork" name="Administer user dashboards"
		class="java.lang.Object" roles-required="admin">

Unfortunately the additional attribute "roles-required" had absolutly no effect. Also this webwork can be called even without a login. I tried several other approaches by using condition, but nothing works so far. In the Documentation I've only found ways to secure websections, plugins etc. but not how this is done for webworks.

Greetings Sebastian

2 answers

1 accepted

1 vote

As you said, conditions can be done only on web-sections, web-items etc thus preventing users from seeing the action. But they will still be able to access it directly.

You need to handle within the action class. Within the methods, check the permissions before doing anything and redirect to a permission error page if the permission is not there.

A typical example:

if (!permissionManager.hasPermission(Permissions.ADMINISTER, getLoggedInUser())) {
    return "securitybreach";

Hi Jobin,

thanks for your answer. I already used a construct like the one you posted, but i thought there must be a way to handle this in the atlassian-plugin.xml. Anyway, i'm fine with this :)

Greetings Sebastian

What Jira version the additional attribute "roles-required" had absolutly no effect?

I'm trying in 5.0.7 and works fine.

sustantivo: usuario, consumidor, adicto, aprovechador

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

3,264 views 14 20
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot