Declarative security is great in
EJB, no question about it. There is a slight problem that seems to be explained in literature with money related examples. Class of the problem: How to implement security on task that requires different security profile for operation involving different amount of moneys. For example junior trader is only allow do to orders up to 100K. In this case it is advise to do it programmatically and entangle business code with security. How about writing two separate methods, one for orders up to certain limit and the other for above. I am not suggesting to hardcode 100K in the name and functionality of the method. I am suggesting that leaving check for the limit inside the method and separating security aspect with declarative approach could be a
pattern to follow in this example. Any other examples where programmatic security is necessary? What do you think?
Best regards.