org.openmrs.annotation
Annotation Type Authorized


@Target(value={METHOD,TYPE})
@Retention(value=RUNTIME)
@Inherited
@Documented
public @interface Authorized

Annotation used to describe service layer authorization attributes.

For example, to require that the user have either View or Add privileges:

     @Authorized ({"View Users", "Add User"})
     public void getUsersByName(String name);
 
or to require that they have all privileges
     @Authorized (value = {"Add Users", "Edit Users"}, requireAll=true)
     public void getUsersByName(String name);
 
or to just require that they be authenticated:
     @Authorized ()
     public void getUsersByName(String name);
 


Optional Element Summary
 boolean requireAll
          If set to true, will require that the user have all privileges listed in value.
 java.lang.String[] value
          Returns the list of privileges needed to access a method.
 

value

public abstract java.lang.String[] value
Returns the list of privileges needed to access a method. (i.e. "View Users"). Multiple privileges are compared with an "or" unless requireAll is set to true

Returns:
String[] The secure method attributes
Default:
{}

requireAll

public abstract boolean requireAll
If set to true, will require that the user have all privileges listed in value. if false, user only has to have one of the privileges. Defaults to false

Returns:
boolean true/false whether the privileges should be "and"ed together
Default:
false

OpenMRS-1.7.x

Generated Apr 27 2012 10:06 PM. NOTE - these libraries are in active development and subject to change