User Tools

Site Tools


auth:ex3

Intro Ex1 Ex2 Ex3 Ex4

Authentication: Enforce appropriate role

Of course, the @Authenticated annotations can specify stronger requirements than simply an authenticated user. For example, moving entire lines should only be allowed for supervisors.

Change your aspect to verify that the user is authenticated and holds at least the role specified by the value() of the @Authenticated annotation.

Employ the @annotation(Var) primitive pointcut to bind the annotation of a join point to a variable.

You can compare two Role objects by comparing their ordinal() values.

Rerun the figure editor to verify your aspect. As before, you should be presented with an authentication dialog when you create a first point. Login as a normal user and create more points and lines. Now try to move a line. At this point, the authentication dialog should return. Change the role to supervisor to continue.


Continue with Exercise 4.

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