Security

From LogicalDOC Community Wiki

Jump to: navigation, search

Contents

Methods to manage security entities

WSUser[] listUsers(String sid)

Gets metadata of all existing users.

Parameters

  • sid - The session identifier. Must be an administrator.

Returns

Throws

  • Exception - If there is any error retrieving the list of users


WSGroup[] listGroups(String sid)

Gets metadata of all existing groups.

Parameters

  • sid - The session identifier. Must be an administrator.

Returns

Throws

  • Exception - If there is any error retrieving the list of groups



long storeGroup(String sid, WSGroup group)

Create/Update a group. You can completely customize the group through a value object containing the user's metadata.

Parameters

  • sid - The session identifier. Must be an administrator.
  • WSGroup - The group to be created/updated.

Returns

  • The created/updated group identifier

Throws

  • Exception - If there is any error storing the data


void deleteUser(String sid, long userId)

Deletes an existing user.

Parameters

  • sid - The session identifier. Must be an administrator.
  • userId - Identifier of the user to be deleted

Returns

  • Nothing

Throws

  • Exception - If there is any error deleting the item


void deleteGroup(String sid, long groupId)

Deletes an existing user.

Parameters

  • sid - The session identifier. Must be an administrator.
  • groupId - Identifier of the group to be deleted

Returns

  • Nothing

Throws

  • Exception - If there is any error deleting the item


int changePassword(String sid, long userId, String oldPassword, String newPassword)

Changes the password of a user.

Parameters

  • sid - The session identifier. Must be an administrator.
  • userId - Identifier of the user to be altered
  • oldPassword - Can be null
  • newPassword - The new password

Returns

  • 0 if all is ok, 1 if the password is incorrect, 2 if the new password cannot be notified, otherwise a positive number grater than 2

Throws

  • Exception - If there is any error deleting the item


WSUser getUser(String sid, long userId)

Gets metadata of an existing user with the given identifier.

Parameters

  • sid - The session identifier. Must be an administrator.
  • userId - Identifier of the user to be retrieved

Returns

Throws

  • Exception - If there is any error retrieving the user


WSGroup getGroup(String sid, long groupId)

Gets metadata of an existing group with the given identifier.

Parameters

  • sid - The session identifier. Must be an administrator.
  • groupId - Identifier of the group to be retrieved

Returns

Throws

  • Exception - If there is any error retrieving the group