KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > kohsuke > stapler > jelly > IsUserInRoleTag


1 package org.kohsuke.stapler.jelly;
2
3 import org.apache.commons.jelly.JellyTagException;
4 import org.apache.commons.jelly.MissingAttributeException;
5 import org.apache.commons.jelly.XMLOutput;
6
7 /**
8  * @author Kohsuke Kawaguchi
9  */

10 public class IsUserInRoleTag extends AbstractStaplerTag {
11     private String JavaDoc role;
12
13     /**
14      * The name of the role against which the user is checked.
15      */

16     public void setRole(String JavaDoc role) {
17         this.role = role;
18     }
19
20     public void doTag(XMLOutput output) throws MissingAttributeException, JellyTagException {
21         if(getRequest().isUserInRole(role))
22             getBody().run(getContext(),output);
23     }
24 }
25
Popular Tags