Package org.imixs.marty.security
Class UserGroupService
java.lang.Object
org.imixs.marty.security.UserGroupService
@DeclareRoles("org.imixs.ACCESSLEVEL.MANAGERACCESS")
@RunAs("org.imixs.ACCESSLEVEL.MANAGERACCESS")
public class UserGroupService
extends Object
user Group service to provide method for managing user and groups settings.
- Author:
- rsoika
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeUserId(String oldID, String newID) This method changes the userID of an existing user entry and updates the userGroup table entries.getCoreGroupName(String deprecatedGroupName) Returns the core group name for a given deprecated group namegetDeprecatedGroupName(String newGroupName) Returns the deprecated group name for a given core group name IMIXS-WORKFLOW-Manager => org.imixs.ACCESSLEVEL.MANAGERACCESS IMIXS-WORKFLOW-Editor => org.imixs.ACCESSLEVEL.EDITORACCESS IMIXS-WORKFLOW-Author => org.imixs.ACCESSLEVEL.AUTHORACCESS IMIXS-WORKFLOW-Reader => org.imixs.ACCESSLEVEL.READERACCESSvoidThis method verifies if a default user id already exists.voidThis method migrates deprecated user rolesvoidremoveUserId(String userID) This method deletes the userID of an existing user entry and also the userGroup table entries.voidupdateUser(org.imixs.workflow.ItemCollection profile) This method verifies the profile data and creates or update the corresponding user entries in the user tables.
-
Field Details
-
ACCESSLEVEL_NOACCESS
-
DEFAULT_ACCOUNT
-
DEFAULT_PASSWORD
-
CORE_GROUPS
-
DEPRECATED_CORE_GROUPS
-
-
Constructor Details
-
UserGroupService
public UserGroupService()
-
-
Method Details
-
updateUser
public void updateUser(org.imixs.workflow.ItemCollection profile) This method verifies the profile data and creates or update the corresponding user entries in the user tables.NOTE: this method did not change a userid. To do this use the method changeUser!
The Method also verifies deprecated role names, fix it and prints out a warning in such a case.
If a new userId entity is generated but no password is provided, the method generates an encrypted random password
- Parameters:
profile-
-
changeUserId
This method changes the userID of an existing user entry and updates the userGroup table entries.- Parameters:
oldID- - the existing userEntrynewID- - the name of the new id
-
removeUserId
This method deletes the userID of an existing user entry and also the userGroup table entries.- Parameters:
userID- - the existing userEntry
-
initUserIDs
public void initUserIDs()This method verifies if a default user id already exists. If no userID exists the method generates a default account 'admin' with password 'adminadmin'- Throws:
org.imixs.workflow.exceptions.AccessDeniedException
-
migrateDeprecatedUserRoles
public void migrateDeprecatedUserRoles()This method migrates deprecated user roles- IMIXS-WORKFLOW-Manager => org.imixs.ACCESSLEVEL.MANAGERACCESS
- IMIXS-WORKFLOW-Editor => org.imixs.ACCESSLEVEL.EDITORACCESS
- IMIXS-WORKFLOW-Author => org.imixs.ACCESSLEVEL.AUTHORACCESS
- IMIXS-WORKFLOW-Reader => org.imixs.ACCESSLEVEL.READERACCESS
First the method tests if a migration is necessary. For that the method tests if the new roles already are existing in the system. Only if not the migration is started
This method can be removed in later versions (but it may need some time)
-
getDeprecatedGroupName
Returns the deprecated group name for a given core group name- IMIXS-WORKFLOW-Manager => org.imixs.ACCESSLEVEL.MANAGERACCESS
- IMIXS-WORKFLOW-Editor => org.imixs.ACCESSLEVEL.EDITORACCESS
- IMIXS-WORKFLOW-Author => org.imixs.ACCESSLEVEL.AUTHORACCESS
- IMIXS-WORKFLOW-Reader => org.imixs.ACCESSLEVEL.READERACCESS
- Parameters:
newGroupName-- Returns:
-
getCoreGroupName
Returns the core group name for a given deprecated group name- Parameters:
deprecatedGroupName-- Returns:
-