public interface BaseAuth
Modifier and Type | Method and Description |
---|---|
void |
assignRole(String userId,
String roleId)
Method to assign a role
|
void |
changeSecurity(String uuid,
ChangeSecurity changeSecurity)
Change several security permissions in the same call.
|
void |
createRole(String roleId,
boolean active)
Method to create a new role
|
void |
createUser(String userId,
String password,
String email,
String name,
boolean active)
Method to create a new user
|
void |
deleteRole(String roleId)
Method to create a delete a role
|
void |
deleteUser(String userId)
Method to delete a user
|
String |
disable2FA()
Disable 2FA
|
String |
generate2FASecret()
Generate 2FA secret
|
Map<String,Integer> |
getGrantedRoles(String uuid)
Get roles permissions from am item (document or folder).
|
Map<String,Integer> |
getGrantedUsers(String uuid)
Get user permissions from am item (document or folder).
|
GrantedUsersAndRolesItem |
getGrantedUsersAndRoles(String uuid)
Get granted users and roles
|
List<Profile> |
getProfiles(boolean filterByActive)
Get all profiles
|
List<String> |
getRoles(boolean showAll)
Retrieves a list of repository roles.
|
List<String> |
getRolesByUser(String userId)
Retrieves a list of roles by user.
|
String |
getSessionId()
Get session
|
InputStream |
getTwoFactorQR(String secret)
Get 2FA
|
CommonUser |
getUser(String userId)
Retrieve information of a given user
|
Profile |
getUserProfile(String userId)
Get user profile
|
List<CommonUser> |
getUsers(boolean showAll)
Retrieve information of a given user
|
List<CommonUser> |
getUsersByRole(String roleId)
Retrieves a list of users by role.
|
List<Tenant> |
getUserTenants()
Get a list of available tenants for a user.
|
void |
grantRole(String uuid,
String roleId,
int permissions,
boolean recursive)
Grant role permissions for a node.
|
void |
grantUser(String uuid,
String userId,
int permissions,
boolean recursive)
Add user permissions to a node.
|
boolean |
hasSecurityRecursive()
Has security recursive
|
boolean |
isAdmin()
Is admin
|
boolean |
isLoginLowercase()
Is login lowercase
|
boolean |
isPasswordExpired()
Check the password of the user expiration
|
boolean |
isTwoFactorAuthentication()
Is two factor authentication
|
void |
overwriteSecurity(String uuid,
ChangeSecurity changeSecurity)
Change several security permissions in the same call.
|
void |
removeRole(String userId,
String roleId)
Method to remove a role
|
void |
revokeRole(String uuid,
String roleId,
int permissions,
boolean recursive)
Revoke role permissions from a node.
|
void |
revokeUser(String uuid,
String userId,
int permissions,
boolean recursive)
Revoke user permissions from a node.
|
void |
setAuthorizationToken(String authorizationToken)
Set token
|
void |
setRolePermissions(String uuid,
String roleId,
int permissions,
boolean recursive)
Set role permissions for a node.
|
void |
setUserPermissions(String uuid,
String userId,
int permissions,
boolean recursive)
Set user permissions to a node
|
void |
setUserProfile(String userId,
long profileId)
Set the user profile
|
void |
setUserTenant(long tenantId)
Update user tenant.
|
void |
updateRole(String roleId,
boolean active)
Update role information
|
void |
updateUser(String userId,
String password,
String email,
String name,
boolean active)
Update user information
|
String |
validate2FAAndSaveSecret(String secret,
int code)
Validate 2FA and save secret
|
String |
verify2FACode(int code)
Verify 2FA code
|
String getSessionId() throws UnknownException, WebserviceException
UnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid setAuthorizationToken(String authorizationToken)
authorizationToken
- the authorization tokenGrantedUsersAndRolesItem getGrantedUsersAndRoles(String uuid) throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
uuid
- Node uuid.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionMap<String,Integer> getGrantedRoles(String uuid) throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
uuid
- Node uuid.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionMap<String,Integer> getGrantedUsers(String uuid) throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
uuid
- Node uuid.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionList<String> getRoles(boolean showAll) throws AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException, UnknownException, WebserviceException
showAll
- If should only return active roles or all themAccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionList<String> getRolesByUser(String userId) throws AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException, UnknownException, WebserviceException
userId
- A user id.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionList<CommonUser> getUsers(boolean showAll) throws AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException, UnknownException, WebserviceException
showAll
- If should only return active users or all themAccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionCommonUser getUser(String userId) throws AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException, UnknownException, WebserviceException
userId
- A user id.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionList<CommonUser> getUsersByRole(String roleId) throws AccessDeniedException, RepositoryException, DatabaseException, PrincipalAdapterException, UnknownException, WebserviceException
roleId
- A role id.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid revokeRole(String uuid, String roleId, int permissions, boolean recursive) throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
uuid
- Node uuid.roleId
- 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.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid revokeUser(String uuid, String userId, int permissions, boolean recursive) throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
uuid
- Node uuid.userId
- 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.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid grantRole(String uuid, String roleId, int permissions, boolean recursive) throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
uuid
- Node uuid.roleId
- 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.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid grantUser(String uuid, String userId, int permissions, boolean recursive) throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
uuid
- Node uuid.userId
- User name which permissions are changed.permissions
- A mask with the permissions to be added.recursive
- If the nodePath indicated a folder, the permissions can be applied recursively.AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid changeSecurity(String uuid, ChangeSecurity changeSecurity) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, UnknownException, WebserviceException
uuid
- Node uuid.changeSecurity
- the change securityPathNotFoundException
- the path not found exceptionAccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid overwriteSecurity(String uuid, ChangeSecurity changeSecurity) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, UnknownException, WebserviceException
uuid
- Node uuid.changeSecurity
- the change securityPathNotFoundException
- the path not found exceptionAccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionboolean isAdmin() throws PrincipalAdapterException, UnknownException, WebserviceException
PrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionboolean hasSecurityRecursive() throws UnknownException, WebserviceException
UnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionboolean isLoginLowercase() throws UnknownException, WebserviceException
UnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionboolean isPasswordExpired() throws UnknownException, WebserviceException
UnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid createUser(String userId, String password, String email, String name, boolean active) throws PrincipalAdapterException, UnknownException, WebserviceException
userId
- A user id.password
- the passwordemail
- the emailname
- the nameactive
- the activePrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid deleteUser(String userId) throws PrincipalAdapterException, UnknownException, WebserviceException
userId
- A user id.PrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid updateUser(String userId, String password, String email, String name, boolean active) throws PrincipalAdapterException, UnknownException, WebserviceException
userId
- A user id.password
- the passwordemail
- the emailname
- the nameactive
- the activePrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid createRole(String roleId, boolean active) throws PrincipalAdapterException, UnknownException, WebserviceException
roleId
- A role id.active
- the activePrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid deleteRole(String roleId) throws PrincipalAdapterException, UnknownException, WebserviceException
roleId
- A role id.PrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid updateRole(String roleId, boolean active) throws PrincipalAdapterException, UnknownException, WebserviceException
roleId
- A role idactive
- the activePrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid assignRole(String userId, String roleId) throws PrincipalAdapterException, UnknownException, WebserviceException
userId
- A user id.roleId
- A role id.PrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid removeRole(String userId, String roleId) throws PrincipalAdapterException, UnknownException, WebserviceException
userId
- A user id.roleId
- A role id.PrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionList<Profile> getProfiles(boolean filterByActive) throws PrincipalAdapterException, WebserviceException, UnknownException
filterByActive
- the filter by activePrincipalAdapterException
- the principal adapter exceptionWebserviceException
- the webservice exceptionUnknownException
- the unknown exceptionProfile getUserProfile(String userId) throws PrincipalAdapterException, WebserviceException, UnknownException
userId
- A user id.PrincipalAdapterException
- the principal adapter exceptionWebserviceException
- the webservice exceptionUnknownException
- the unknown exceptionvoid setUserProfile(String userId, long profileId) throws PrincipalAdapterException, WebserviceException, UnknownException
userId
- The user id.profileId
- The profile to be assigned.PrincipalAdapterException
- the principal adapter exceptionWebserviceException
- the webservice exceptionUnknownException
- the unknown exceptionvoid setUserPermissions(String uuid, String userId, int permissions, boolean recursive) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, WebserviceException, UnknownException
uuid
- Node uuid.userId
- User name which permissions are set.permissions
- User name which permissions are set.recursive
- recursive – If the nodePath indicated a folder, the permissions can be applied recursively.PathNotFoundException
- the path not found exceptionAccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionWebserviceException
- the webservice exceptionUnknownException
- the unknown exceptionvoid setRolePermissions(String uuid, String roleId, int permissions, boolean recursive) throws PathNotFoundException, AccessDeniedException, RepositoryException, DatabaseException, WebserviceException, UnknownException
uuid
- Node uuid.roleId
- Role name which permissions are set.permissions
- A mask with the permissions to be set.recursive
- If the nodePath indicates a folder, the permissions can be applied recursively.PathNotFoundException
- the path not found exceptionAccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionWebserviceException
- the webservice exceptionUnknownException
- the unknown exceptionList<Tenant> getUserTenants() throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
AccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionvoid setUserTenant(long tenantId) throws AccessDeniedException, RepositoryException, DatabaseException, PathNotFoundException, UnknownException, WebserviceException
tenantId
- tenantId tenant idAccessDeniedException
- the access denied exceptionRepositoryException
- the repository exceptionDatabaseException
- the database exceptionPathNotFoundException
- the path not found exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionboolean isTwoFactorAuthentication() throws UnknownException, WebserviceException
UnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionInputStream getTwoFactorQR(String secret) throws PrincipalAdapterException, UnknownException, WebserviceException
secret
- the secretPrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionString generate2FASecret() throws PrincipalAdapterException, UnknownException, WebserviceException
PrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionString validate2FAAndSaveSecret(String secret, int code) throws PrincipalAdapterException, UnknownException, WebserviceException
secret
- the secretcode
- the codePrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionString disable2FA() throws PrincipalAdapterException, UnknownException, WebserviceException
PrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionString verify2FACode(int code) throws PrincipalAdapterException, UnknownException, WebserviceException
code
- the codePrincipalAdapterException
- the principal adapter exceptionUnknownException
- the unknown exceptionWebserviceException
- the webservice exceptionCopyright © 2021 Open Knowledge Management System S.L.. All Rights Reserved.