anchor.diff:  ----
   
   === Restrict Transactions
  -A Transcation can restrict execution to one or more roles by the Role Annotation:
  +A Transaction can restrict execution to one or more roles by the Role Annotation:
   [source,java]
   ----
   @Role("Developer")
  
positive.code: 
  	public <T> T doExecute(Transaction<T> transaction) {
  		if (isAuthenticationActive()) {
  			getAuthorization().check(transaction);
  		}
  		try {
  			currentTransaction.set(transaction);
  			return transaction.execute();
  		} finally {
  			currentTransaction.set(null);
  
negative.code: }
  ----
  
  ==== Restrict operations on entity classes
  
  If you want to restrict only certain operations on an entity you can implement extensions of the EntityTransactions and give them special
  Annotations.
  
  [source,java]
  ----
  @Role("RoleY")
  public class ReadEntityTransaction<Entity> extends ReadTransaction<Entity, Entity> {
  	private static final long serialVersionUID = 1L;
  
  	public ReadEntityTransaction(Object id) {
  		super(Entity.class, id);
  	}
  }	
  ----
  
  Or
  
  [source,java]
  ----
  @Role("RoleZ")
  public class InsertEntityTransaction<Entity> extends InsertTransaction<Entity, Object> {
  	private static final long serialVersionUID = 1L;
  
  	public InsertTransaction(Entity entity) {
  		super(entity);
  	}
  }	
  ----
  
  To only allow read access on an entity as simple way is to define a View on this entity and to annotate this View class:
  
  [source,java]
  ----
  @Role("Everybody")
  public class EntityView implements View<Entity> {
  
  	[..]
  }
  ----
  
  
  === Package wide roles
  The needed roles for a Transaction or a business entity can also be specified on a package level. You can
  specify these roles in the package-info.java file. If you don't know about this file you may have a look at
  the link:https://docs.oracle.com/javase/specs/jls/se8/html/jls-7.html[Oracle documentation]. The package-info.java
  makes it possible to annotate the package.
  
  