User Tools

Site Tools


auth:intro

Intro Ex1 Ex2 Ex3 Ex4

Authentication: Intro

In these exercises, we will use AspectJ and annotations to protect the access to a number of methods in the figure editor application.

Set-up & Running

You can reuse the AspectJ project with the figure editor application you have created during the previous track. If you haven't got such a project yet, consult the Invariants: Intro page.

@Authenticated Annotation

Have a look at the annotation defined as Authenticated inside the package figures.annotations. It is used to mark methods and constructors to which we want to restrict access. The Role enumeration is used to mark different roles with an increasing clearance level: user, supervisor and administrator.

You can find out where this annotation is being used by right-clicking it and selecting ReferencesProject. Note that we have already employed this annotation to mark the following access restrictions:

  1. Points can only be created and moved by authenticated users (or supervisors, or administrators).
  2. Lines can only be created by authenticated users (or supervisors, or administrators); they can only be moved by supervisors (or administrators).

In this track, we will use aspects to enforce the access restriction specified by these annotations.


Start the track at Exercise 1.

auth/intro.txt · Last modified: 2021/02/05 13:47 (external edit)