public interface AuthModule
Modifier and Type | Method and Description |
---|---|
void |
assignRole(String token,
String user,
String role)
Method to assign a role
|
void |
changeSecurity(String token,
String nodePath,
Map<String,Integer> grantUsers,
Map<String,Integer> revokeUsers,
Map<String,Integer> grantRoles,
Map<String,Integer> revokeRoles,
boolean recursive)
Change several security permissions in the same call.
|
void |
createRole(String token,
String role,
boolean active)
Method to create a new role
|
void |
createUser(String token,
String user,
String password,
String email,
String name,
boolean active)
Method to create a new user
|
void |
deleteRole(String token,
String role)
Method to create a delete a role
|
void |
deleteUser(String token,
String user)
Method to create a delete a user
|
Map<String,Integer> |
getGrantedRoles(String token,
String nodeId)
Get roles permissions from am item (document or folder).
|
Map<String,Integer> |
getGrantedUsers(String token,
String nodeId)
Get user permissions from am item (document or folder).
|
String |
getMail(String token,
String user)
Retrieves the mail from an user.
|
String |
getName(String token,
String user)
Retrieves the name from an user.
|
List<String> |
getRoles(String token)
Retrieves a list of repository roles.
|
List<String> |
getRolesByUser(String token,
String user)
Retrieves a list of roles by user.
|
List<String> |
getUsers(String token)
Retrieves a list of repository users
|
List<String> |
getUsersByRole(String token,
String role)
Retrieves a list of users by role.
|
void |
grantRole(String token,
String nodeId,
String role,
int permissions,
boolean recursive)
Grant role permissions for a node.
|
void |
grantUser(String token,
String nodeId,
String user,
int permissions,
boolean recursive)
Add user permissions to a node.
|
void |
login()
Logins into the repository.
|
String |
login(String user,
String password) |
void |
logout(String token)
Log out from the repository.
|
void |
removeRole(String token,
String user,
String role)
Method to remove a role
|
void |
revokeRole(String token,
String nodeId,
String role,
int permissions,
boolean recursive)
Revoke role permissions from a node.
|
void |
revokeUser(String token,
String nodeId,
String user,
int permissions,
boolean recursive)
Revoke user permissions from a node.
|
void |
updateRole(String token,
String role,
boolean active)
Update role information
|
void |
updateUser(String token,
String user,
String password,
String email,
String name,
boolean active)
Update user information
|
void login() throws RepositoryException, DatabaseException
RepositoryException
DatabaseException
String login(String user, String password) throws AccessDeniedException, RepositoryException, DatabaseException
void logout(String token) throws RepositoryException, DatabaseException
RepositoryException
DatabaseException
void grantUser(String token, String nodeId, String user, int permissions, boolean recursive) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
nodeId
- The complete path to the node or its UUID.user
- User name which permissions are changed.permissions
- A mask with the permissions to be added.recursive
- recursive – If the nodePath indicated a folder,
the permissions can be applied recursively.PathNotFoundException
- If the node defined by nodePath do not exists.AccessDeniedException
- If the authorization information is not valid.RepositoryException
- If there is any error accessing to the repository.DatabaseException
void revokeUser(String token, String nodeId, String user, int permissions, boolean recursive) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
nodeId
- The complete path to the node or its UUID.user
- User name which permissions are changed.permissions
- A mask with the permissions to be removed.recursive
- If the nodePath indicates a folder, the
permissions can be revoked recursively.PathNotFoundException
- If the node defined by nodePath do not exists.AccessDeniedException
- If the authorization information is not valid.RepositoryException
- If there is any error accessing to the repository.DatabaseException
Map<String,Integer> getGrantedUsers(String token, String nodeId) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
nodeId
- The complete path to the node or its UUID.PathNotFoundException
- If the node defined by nodePath do not exists.AccessDeniedException
- If the authorization information is not valid.RepositoryException
- If there is any error accessing to the repository.DatabaseException
void grantRole(String token, String nodeId, String role, int permissions, boolean recursive) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
nodeId
- The complete path to the node or its UUID.role
- Role name which permissions are changed.permissions
- A mask with the permissions to be added.recursive
- If the nodePath indicates a folder, the permissions can
be applied recursively.PathNotFoundException
- If the node defined by nodePath do not exists.AccessDeniedException
- If the authorization information is not valid.RepositoryException
- If there is any error accessing to the repository.DatabaseException
void revokeRole(String token, String nodeId, String role, int permissions, boolean recursive) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
nodeId
- The complete path to the node or its UUID.role
- Role name which permissions are changed.permissions
- A mask with the permissions to be removed.recursive
- If the nodePath indicates a folder, the
permissions can be applied recursively.PathNotFoundException
- If the node defined by nodePath do not exists.AccessDeniedException
- If the authorization information is not valid.RepositoryException
- If there is any error accessing to the repository.DatabaseException
Map<String,Integer> getGrantedRoles(String token, String nodeId) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
nodeId
- The complete path to the node or its UUID.PathNotFoundException
- If the node defined by nodePath do not exists.AccessDeniedException
- If the authorization information is not valid.RepositoryException
- If there is any error accessing to the repository.DatabaseException
List<String> getUsers(String token) throws PrincipalAdapterException
RepositoryException
- If there is any error retrieving the users list.PrincipalAdapterException
List<String> getRoles(String token) throws PrincipalAdapterException
RepositoryException
- If there is any error retrieving the roles list.PrincipalAdapterException
List<String> getUsersByRole(String token, String role) throws PrincipalAdapterException
RepositoryException
- If there is any error retrieving the user list.PrincipalAdapterException
List<String> getRolesByUser(String token, String user) throws PrincipalAdapterException
RepositoryException
- If there is any error retrieving the roles list.PrincipalAdapterException
String getMail(String token, String user) throws PrincipalAdapterException
user
- The user id.RepositoryException
- If there is any error retrieving the mail.PrincipalAdapterException
String getName(String token, String user) throws PrincipalAdapterException
user
- The user id.RepositoryException
- If there is any error retrieving the mail.PrincipalAdapterException
void changeSecurity(String token, String nodePath, Map<String,Integer> grantUsers, Map<String,Integer> revokeUsers, Map<String,Integer> grantRoles, Map<String,Integer> revokeRoles, boolean recursive) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException
void createUser(String token, String user, String password, String email, String name, boolean active) throws PrincipalAdapterException
user
- A user id.password
- The password of the user.email
- The user mail.name
- The full user name.PrincipalAdapterException
- If any error occurs.void deleteUser(String token, String user) throws PrincipalAdapterException
user
- A user id.PrincipalAdapterException
- If any error occurs.void updateUser(String token, String user, String password, String email, String name, boolean active) throws PrincipalAdapterException
user
- A user id.password
- The password of the user.email
- The user mail.name
- The full user name.PrincipalAdapterException
- If any error occurs.void createRole(String token, String role, boolean active) throws PrincipalAdapterException
role
- A role id.PrincipalAdapterException
- If any error occurs.void deleteRole(String token, String role) throws PrincipalAdapterException
role
- A role id.PrincipalAdapterException
- If any error occurs.void updateRole(String token, String role, boolean active) throws PrincipalAdapterException
role
- A role id..PrincipalAdapterException
- If any error occurs.void assignRole(String token, String user, String role) throws PrincipalAdapterException
user
- A user id.role
- A role id.PrincipalAdapterException
- If any error occurs.void removeRole(String token, String user, String role) throws PrincipalAdapterException
user
- A user id.role
- A role id.PrincipalAdapterException
- If any error occurs.Copyright © 2016. All rights reserved.