Best Place to check permission

Hi,What is the best place to check security constraints. Is it the front controller of web app or a session facade.Thanking You,Chamal.
[163 byte] By [chamalsla] at [2007-10-2 22:46:34]
# 1
As soon as you know you will need the permission is when you should check for it.
_dnoyeBa at 2007-7-14 6:00:57 > top of Java-index,Other Topics,Patterns & OO Design...
# 2

I would have a session facade do it. You should "divide and conquer." I would have a controller react to what the session facade comes up with (e.g., if the user doesn't have the permission, the controller would disable some elements of the UI). If you have the session facade object do the reacting (e.g., disable UI elements itself) then it will be coupled with the UI and harder to swap implementations. And, as beyond_ said, you should do this work when you need to know the permission.

ktm5124a at 2007-7-14 6:00:57 > top of Java-index,Other Topics,Patterns & OO Design...