Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Can not retrieve information from the passing parameters

Ok..just so you know I'm also a newbie..but seems like you could change your pointcut strategy to give yourself access to the class using target instead of args.  Then you could introduce
methods on that class like getVector() and getUserInfo()...You would still achieve your results - the class itself would never know about the access control.

lily lily <lixiaojiao@xxxxxxxxxxx> wrote:
Hi:
I am working on a web application of a database. JSPs provide the
presentation logic, Java Servlets provide control to the flow of data, Java
Beans do the actual data access to the database. Now I want to add an access
control to it using aspectJ.

The accsss control code is like this:

---------------------------------------------------------------------------------------
package tables;

import java.io.*;
import java.util.*;

aspect AccessControl perthis(checkpoint(Vector))
{
pointcut checkpoint(Vector v): execution(public String
project.insert(Vector)throws ClassNotFoundException) && args(v);

String around(Vector v): checkpoint(v)
{
check the access availability, if true
return proceed(v);
otherwise,
return "NotAllowed";
}
}
--------------------------------------------------------------------------------------

The problem is that when I do the access control, I need some user
information like user's name, user's ID to determine the result. But I
could not get such information from the passing parameters of method
project.insert. I could add another parameter called say 'UserInfo' to the
project.insert method in order to retrieve the user information. But this is
not what I want. I do not want to touch any of the project.insert code. This
will make Plugging and Unplugging the access control easily in the furture.
The programmer of method project.insert does not even realize that the
access control exists.

Is this possible? How to solve it?

Thanks in advance.

Lily

_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*
http://join.msn.com/?page=features/junkmail

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
http://dev.eclipse.org/mailman/listinfo/aspectj-users


Do you Yahoo!?
The New Yahoo! Search - Faster. Easier. Bingo.

Back to the top