Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] can user aspectj to forbid a method execute?

You could also use before advice and if not authorized, throw an exception
to prevent the method from executing. If you do this, then something else
needs to handle the exception. And if the method doesn’t declare it might
throw a relevant exception, you’d need to use an unchecked exception (e.g.,
a subclass of RuntimeException).

 

  _____  

From: aspectj-users-bounces@xxxxxxxxxxx
[mailto:aspectj-users-bounces@xxxxxxxxxxx] On Behalf Of Ron DiFrango
Sent: Thursday, June 29, 2006 9:52 AM
To: anydocs@xxxxxxxxx; aspectj-users@xxxxxxxxxxx
Subject: RE: [aspectj-users] can user aspectj to forbid a method execute?

 

You could do this with around advice, with the advice containing the logic
to check the role before issuing the proceed to the underlying call or
return with a "Not Authorized" message.

 

  _____  

From: aspectj-users-bounces@xxxxxxxxxxx on behalf of creatxr
Sent: Thu 6/29/2006 12:37 PM
To: aspectj-users
Subject: [aspectj-users] can user aspectj to forbid a method execute?

aspectj-users,

 

 

can user aspectj to forbid a method execute? 

I want to use it for authorization.

 

when user without role "ROLE_X" call method "callme", the method "callme"
will not excute.

 

 

creatxr,anydocs@xxxxxxxxx
<mailto:%3c!--AID_FROMADDRESS_BEGIN--%3eanydocs@xxxxxxxxx%3c!--AID_FROMADDRE
SS_END--%3e> 

2006-06-30 

 

<<attachment: winmail.dat>>


Back to the top