Tuesday, August 22, 2006

Roma Framework: finally the Users Module working

Today I've finished the first tests about the new Users module in ROMA Framework. What is the Users Module? It contains all domain POJO to manage login, accounts and profiles in the most classic fashion.

Yes, since most often applications handle User and authentication in the same way, why don't implement a flexible POJOs in ROMA? That is the Users Module. It depends by JPOX persistence module (JDO 2.0) to store user information in the database.

The most powerful thing, IMHO, is the profiling system. I tried to implement the most flexible system to define profiles:
  • Each profile defines the mode, namely the way functions play:
    • allow all but: you can define the exception. Use this when exception are less than all functionalities
    • deny all but: you can define only what the profile can access. Use this when functions are much less than the total.
  • Each profile can define a parent profile where to inherit the functionalities allowed and denied.
  • Functionalities are expressed as a simple name in the format below:
    • ClassName
    • ClassName.field
    • ClassName.action
  • In this way you can profile from the Class level until each field/action!
How to use it?

If you want to disable the Control Panel item from the main menu, just insert the function with name "MainMenu.controlPanel" (that is the action name that call the submenu) and with allow equals to false.

If you'd like to hide the employee's salary field to the "Visitor" profile, then set it with mode "Allow all but" and insert the function "Employee.salary" with allow equals to false. That is.

Roma controller will check for each POJO's fields and actions if the current user profile is allowed to display.

Simple, powerful and easy!

Users module contain also an Activity Log manager, a default implementation for the AuthenticationAspect using BaseAccount and BaseProfile POJOs, generic useful objects such as Info and GenericValue, and more.

To use it download the latest SVN revision and type:
roma addModule domain-users

Follow the link to know more: http://romaframework.xwiki.com/xwiki/bin/view/Doc/Domain+Users

No comments: