tomee-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kaloyan Spiridonov <k.i.spirido...@gmail.com>
Subject @RunAs does not work properly when it is used in servlet
Date Tue, 15 Aug 2017 13:20:04 GMT
Hello,

I have the following scenario:

Servlet -> EjbOne -> EjbTwo
My expectation is that @RunAs of the servlet will be propagated to EjbOne
and the @RunAs of the EjbOne will be propagated to @EjbTwo.
But this does not happen - see the output below. When i remove @RunAs
annotation from the servlet the @RunAs of EjbOne is propagated correctly.

Actual output:

EjbOne (Before EjbTwo) expected role: Manager, isCallerInRole("Manager"):
false
EjbOne (Before EjbTwo) expected role: Manager, isCallerInRole("VP"): false
EjbOne (Before EjbTwo) expected role: Manager,)
isCallerInRole("Administrator"): false
EjbTwo expected role: VP, isCallerInRole("Manager"): false
EjbTwo expected role: VP, isCallerInRole("VP"): false
EjbTwo expected role: VP, isCallerInRole("Administrator"): false
EjbOne (After EjbTwo) expected role: Manager, isCallerInRole("Manager"):
false
EjbOne (After EjbTwo) expected role: Manager, isCallerInRole("VP"): false
EjbOne (After EjbTwo) expected role: Manager,
isCallerInRole("Administrator"): false


Expected output:

EjbOne (Before EjbTwo) expected role: Manager, isCallerInRole("Manager"):
true
EjbOne (Before EjbTwo) expected role: Manager, isCallerInRole("VP"): false
EjbOne (Before EjbTwo) expected role: Manager,)
isCallerInRole("Administrator"): false
EjbTwo expected role: VP, isCallerInRole("Manager"): false
EjbTwo expected role: VP, isCallerInRole("VP"): true
EjbTwo expected role: VP, isCallerInRole("Administrator"): false
EjbOne (After EjbTwo) expected role: Manager, isCallerInRole("Manager"):
true
EjbOne (After EjbTwo) expected role: Manager, isCallerInRole("VP"): false
EjbOne (After EjbTwo) expected role: Manager,
isCallerInRole("Administrator"): false

Here is the source of the application: https://github.com/kal0ian/Examples

Regards,
Kaloyan

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message