As we have seen in the section 3, with the crud command Roma generates set of classes to support CRUD operations. When install the users module these classes are automatically available for the BaseAccount and BaseProfile so we can manage users and profiles as we do with the domain classes we have created. In the AuthenticatedHomePage class we add the following method:
@FlowAction(next=BaseAccountMain.class)
public void Users() {
}
and ordered the actions with the annotation:
@CoreClass(orderActions = "Risks Attacks Companies Users Logout")
Now we compile, execute and log in the application with the admin account where we have administrator privileges. In the AuthenticatedHomePage we click in accounts and select new. Now we create a new user called user1 filling the form with the following data:
Name - user1
Email user1@mail.com
Password user1
Change password next login - false
Status – Active
Clicking in the profile we create a new Profile for the user1 with the following information:
Mode – Allow all but
Name - Developer
Parent – None
Home Page – AuthenticatedHomePage
Available class names – AuthenticatedHomePage
When selected AuthenticatedHomePage from the Available class names a list with all the methods of the class will show in the functions list. Add the methods accounts() and attacks() to the functions list and make sure that for each two method the allow checkbox is unchecked.
The mode Allow all but means that all operations will be allowed except those specifically indicated. On the other hand, the Deny all but mode means that only the specified methods will be shown.
Now repeat these steps to create a new account called with a new profile called User but with mode deny all but. This time select the method companies(), risks() and logout() from AuthenticatedHomePage and check the allow checkbox.
If we stop, compile, re-run the application and login with the user user1 we can observe that in the AuthenticatedHomePage does not appear the attacks and accounts> actions.
Last Update: 2008-08-18
| << Prev | Roma Users module | Next>> |
0 Ficheros adjuntos