com.ibm.commerce.collaboration.workspaces.commands
Class ChangeUserRoleCtrlCmdImpl
com.ibm.commerce.command.AbstractECTargetableCommand
|
+--com.ibm.commerce.command.ControllerCommandImpl
|
+--com.ibm.commerce.tools.command.ToolsControllerCommandImpl
|
+--com.ibm.commerce.collaboration.workspaces.commands.ChangeUserRoleCtrlCmdImpl
- All Implemented Interfaces:
- AccCommand, ChangeUserRoleCtrlCmd, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, ToolsControllerCommand
- public class ChangeUserRoleCtrlCmdImpl
- extends ToolsControllerCommandImpl
- implements ChangeUserRoleCtrlCmd
Changes the role of a member in the collaborative workspace. The following roles can be assigned to the member:
- manager: This role has access read and write information in the collaborative workspace; and to add,
change, or remove member access.
- author: This role has access to read and write information in the collaborative workspace.
- reader: This role has access to read or view information in the collaborative workspace.
Behaviour
The command does the following a member in the collaborative workspace:
- Verifies that the user requesting the action has a Manager role in the collaborative workspace
or a Site Administrator role in the seller organization. Otherwise, the requester does not have the authority
to execute this command.
- Creates an instance of the CollabManagerAccessBean.
- Removes original role of the user by calling the deleteXXXGroupMember in the access bean
where XXX refers to the original role of the user.
- Adds the user to the new role by calling the addXXXGroupMember in the access bean
where XXX refers to the new role of the user.
Exception Conditions
If the collaborative workspace Id parameter is missing, the command sets the _ERR_MISSING_CMD_PARAMETER
exception task to handle the error.
If the user requester does not have the authority to execute the AddMember function, the command sets the
EC_ERROR_COLLAB_NO_AUTHORIZATION exception task to handle the error.
Method Summary |
java.lang.String |
getCollabSpaceId()
Gets the unique identifier associated with the collaborative workspace. |
java.lang.String |
getMemberId()
Gets the unique identifier of the member whose role is to be changed. |
AccessVector |
getResources()
Gets the access control resources corresponding to the command. |
java.lang.String |
getRole()
Gets the new role that is to be assigned to the collaborative workspace member. |
void |
performExecute()
Contains the business logic for the command. |
void |
setCollabSpaceId(java.lang.String newCollabSpaceId)
Sets the unique identifier associated with the collaborative workspace to a local variable. |
void |
setMemberId(java.lang.String newMemberId)
Sets the unique identifier of the collaborative workspace member whose role is to be changed. |
void |
setRequestProperties(TypedProperty reqParms)
Gets the input parameters from the requestProperties object and sets each parameter to a local variable. |
void |
setRole(java.lang.String newRole)
Sets the new role of the collaborative workspace member to a local variable. |
void |
validateParameters()
Validates that the syntax of the input parameters are correct. |
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl |
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties |
Methods inherited from interface com.ibm.commerce.command.ControllerCommand |
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties |
CLASSNAME
public static final java.lang.String CLASSNAME
COPYRIGHT
public static final java.lang.String COPYRIGHT
ChangeUserRoleCtrlCmdImpl
public ChangeUserRoleCtrlCmdImpl()
getCollabSpaceId
public java.lang.String getCollabSpaceId()
- Gets the unique identifier associated with the collaborative workspace.
- Returns:
- The collaborative workspace Id.
getMemberId
public java.lang.String getMemberId()
- Gets the unique identifier of the member whose role is to be changed.
- Returns:
- The collaborative workspace member Id.
getResources
public AccessVector getResources()
throws ECException
- Gets the access control resources corresponding to the command.
- Specified by:
getResources
in interface ECCommand
- Overrides:
getResources
in class AbstractECTargetableCommand
- Returns:
- The access vector associated with the command.
- Throws:
ECException
- If the access control resources cannot be retrieved.
getRole
public java.lang.String getRole()
- Gets the new role that is to be assigned to the collaborative workspace member. The role can be "manager",
"author", or "reader".
- Returns:
- The new role of the collaborative workspace member.
performExecute
public void performExecute()
throws ECException
- Contains the business logic for the command.
- Specified by:
performExecute
in interface ECCommand
- Overrides:
performExecute
in class AbstractECTargetableCommand
- Following copied from interface:
com.ibm.commerce.command.ECCommand
- Throws:
com.ibm.commerce.command.CommandException
- The superclass for all ECExceptions.
setCollabSpaceId
public void setCollabSpaceId(java.lang.String newCollabSpaceId)
- Sets the unique identifier associated with the collaborative workspace to a local variable.
- Parameters:
newCollabSpaceId
- The collaborative workspace Id.
setMemberId
public void setMemberId(java.lang.String newMemberId)
- Sets the unique identifier of the collaborative workspace member whose role is to be changed.
- Parameters:
newMemberId
- The collaborative workspace member Id.
setRequestProperties
public void setRequestProperties(TypedProperty reqParms)
throws ECApplicationException
- Gets the input parameters from the requestProperties object and sets each parameter to a local variable.
- Specified by:
setRequestProperties
in interface ControllerCommand
- Overrides:
setRequestProperties
in class ToolsControllerCommandImpl
- Parameters:
reqParms
- The input parameters that are received by the command.- Throws:
ECApplicationException
- If the collaborative workspace Id is missing.
setRole
public void setRole(java.lang.String newRole)
- Sets the new role of the collaborative workspace member to a local variable.
- Parameters:
newRole
- The new role of the collaborative workspace member.
validateParameters
public void validateParameters()
throws ECException
- Validates that the syntax of the input parameters are correct.
- Specified by:
validateParameters
in interface ECCommand
- Overrides:
validateParameters
in class AbstractECTargetableCommand
- Following copied from interface:
com.ibm.commerce.command.ECCommand
- Throws:
ECException.
-