views:

61

answers:

1

I have been using my own internal custom authorization model which evaluates whether a user has permission to view, edit, delete, or create an item. For instance, one place I use this is to determine if a user has permission to view a resource. I have some restrictions such as whether the item is published, whether the user belongs to the necessary group / role, etc.

I store all of that information in a database where I audit the permissions and who changed them for a given entity. To evaluate whether a user has permission, I have a Hibernate Event Listener that takes the current user and other contextual information and evaluates that against the entity.

Is this a good security model, would JAAS / JAAC or DROOLS work better here?

+1  A: 

Instead of JAAS or a rule engine based solution, I'd consider Apache Shiro (formerly JSecurity) for pluggable and flexible Authentication and Authorization. Have a look at What is Shiro?.

But if you have a working solution, why not stick with it if it gets the job done.

Pascal Thivent
It works, but it is my own home grown solution - if there is something that is more standardized, then I'd switch to that for maintenance reasons. I'll look into Apache Shiro.