KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > kohsuke > stapler > LimitedTo


1 package org.kohsuke.stapler;
2
3 import static java.lang.annotation.ElementType.FIELD JavaDoc;
4 import static java.lang.annotation.ElementType.METHOD JavaDoc;
5 import java.lang.annotation.Retention JavaDoc;
6 import static java.lang.annotation.RetentionPolicy.RUNTIME JavaDoc;
7 import java.lang.annotation.Target JavaDoc;
8
9 /**
10  * Declares that methods are only available for requests that
11  * have the specified role(s).
12  *
13  * <p>
14  * This annotation should be placed on methods that need to be
15  * secured (iow protected from anonymous users.)
16  *
17  * @author Kohsuke Kawaguchi
18  */

19 @Retention JavaDoc(RUNTIME)
20 @Target JavaDoc({METHOD,FIELD})
21 public @interface LimitedTo {
22     /**
23      * The name of role.
24      * the method can be invoked only if the user belongs
25      * to this role.
26      */

27     String JavaDoc value();
28 }
29
Popular Tags