[阅读: 315] 2005-07-04 08:35:50
public aspect UserPermisionCheckAspect
{
// pointcut, for calling the User.changeSystemConfiguration
pointcut callChangeSystem(User user_, Computer x): call ( * User.changeSystemConfiguration(Computer) )
&& target(user_) && args(x);
void around(User user_, Computer x)
throws InsufficientPermissionException :
callChangeSystem(user_, x)
{
String username = user_.getName();
//System.out.println("Username: " + username + ". computer: " + x.getName());
if (!user_.getName().equals("Administrator"))
{
throw new InsufficientPermissionException("The user: " + user_.getName() +" have no permission to change the system.");
}
// continue the process.
proceed(user_, x);
}
}
I don't mind if you r FAT.
I don't mind if you r UGLY.
I don't mind if you ACT CUTE.
But I can't STAND if you r FAT, UGLY and still ACT CUTE.