UserManagement Core

From Gcube Wiki
Revision as of 09:51, 3 May 2016 by Massimiliano.assante (Talk | contribs) (UserManager APIs)

Jump to: navigation, search

User Management

Introduction

User Management is a library that sits between the Liferay portal services and gCube portlets. The main functionality of the Library is to provide management of users, roles and organizations. It provides a layer of abstraction above the liferay services, hiding the configuration complexities of roles and organizations. The gcube requirement of roles in the scope of organization is achieved by creating a role with the organization name suffixed to it. The addition/removal of organization names to the role names are handled by the Library and are transparent to the application and portlets using the library.

Interfaces

The library exposes three interfaces:

  • User Manager
  • Role Manager
  • Group(Organization) Manager

These interfaces provide the functionalities necessary for CRUD operation on Users, Roles and Organizations and additional functionalities that organise users into Organizations and assigning/dismissal of roles.

Maven Dependency

Add the following dependency to your maven project to use the library.

<dependency>
	<groupId>org.gcube.dvos</groupId>
	<artifactId>usermanagement-core</artifactId>
	<version>[2.0.0-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
	<scope>provided</scope>
</dependency>

UserManager APIs

The UserManager interface allows to create, retrieve and delete users. In order to perform such operations you need to instanciate the proper manager. See the below example.

// Instanciate the manager
UserManager userManager = new LiferayUserManager();
 
//you want to retrieve information about an existing user
GCubeUser userByMail = userManager.getUserByEmail(validUserMail);

The UserManager offers a lot of other utilities. They are reported below:

  • get user information such as email, id, username, professional information, fullname and much more;
  • list all the users;
  • list users belonging to a given group.

but also create/delete user methods;

GroupManager APIs

RoleManager APIs