Ripla

Rich Platform project for Java web applications.

This project is maintained by aktion-hip

Users and Permissions

Ripla provides an implementation of the OSGi user admin service to manage users and their access rights. In addition, Ripla provides a permisson service for that use case bundles can create permissions to restrict the access to resources they control.

Applications that want to use this functionality have to initialize the registered permissions. This can be done by calling RiplaApplication.initializePermissions(). By calling this method, a permission group will be created for each registered IPermissionEntry and the members defined in those permission instances will be added to the permission groups.

This requires that such member instances exist already. Thus, subclasses have to prepare groups (i.e. roles) that can act as members for the registered permission groups before the registered permission instances are processed.

Therefore, the initialization method is best called in the application class' method that binds the user admin service to the application. E.g.:

public class DemoApplication extends RiplaApplication {
//...
    public void setUserAdmin(final UserAdmin inUserAdmin) {
        super.setUserAdmin(inUserAdmin);
        Group lAdministrators = (Group) inUserAdmin.createRole("ripla.admin", Role.GROUP);
        initializePermissions();
    }
}