Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 328277

Summary: [services] [uaa] handle @Authorize annotation in injection engine
Product: z_Archived Reporter: Erdal Karaca <erdal.karaca.de>
Component: E4Assignee: Project Inbox <e4.runtime-inbox>
Status: NEW --- QA Contact:
Severity: enhancement    
Priority: P3 CC: bokowski, cvgaviao, ob1.eclipse, pwebster
Version: unspecified   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on: 330671    
Bug Blocks:    

Description Erdal Karaca CLA 2010-10-20 14:12:05 EDT
Once an authorisation service is available, it would be convenient to annotate specific 'execution join points' (in AspectJ this is for instance a method execution) to authorize its usage.

E.g.:

@Permission
public void executeMyMagicMethod() {
  // execute code that must be authorized
}

The injection engine would have to resolve an/the authorisation service instance (from the IEclipseContext) and call its authorise method.

There are plenty of other join points where the Permisssion annotation could be used such as the other core annotations...
Comment 1 Erdal Karaca CLA 2010-10-20 15:02:36 EDT
Just a note: The 'Permission' identifier is already in use by the authentication service (in UAA services API)... so, it should be called @Authorize...
Comment 2 Paul Webster CLA 2010-11-19 08:04:46 EST
One of the things discussed was the basic concept of a User and their Roles.  Once that's in place, then roles would be assigned to various places in the model.  Ex, a Part Descriptor, or a Part in a stack, or a Command or a MenuContribution.

Consumers of those pieces of the model would have to validate their behavior (is it visible to this user, can this user execute it) based on matching roles.

PW
Comment 3 Oleg Besedin CLA 2010-11-19 10:52:52 EST
I'd rather call it "@Privileged(String permission)" to be in line with the rest of Java.

I don't think it ties well into injection. Rather, I'd prefer to see an analog of "doPrivileged()" method, maybe, tied to an Eclipse context.