com.ibm.commerce.usermanagement.commands
Class MemberRoleUnassignCmdImpl
- java.lang.Object
-
- com.ibm.websphere.command.TargetableCommandImpl
-
- com.ibm.websphere.command.CacheableCommandImpl
-
- com.ibm.commerce.command.MeasuredCacheableCommandImpl
-
- com.ibm.commerce.command.AbstractECTargetableCommand
-
- com.ibm.commerce.command.ControllerCommandImpl
-
- com.ibm.commerce.usermanagement.commands.MemberRoleUnassignCmdImpl
-
- All Implemented Interfaces:
- AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, MemberRoleUnassignCmd, com.ibm.websphere.cache.Sizeable, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, com.ibm.websphere.command.TargetableCommand, java.io.Serializable
public class MemberRoleUnassignCmdImpl extends ControllerCommandImpl implements MemberRoleUnassignCmd
The MemberRoleUnassign command unassigns roles for a member from orgEntities.The member can be a user, organization or organizational unit. When unassigning roles from organization or organizational unit, the member ID and organization entity ID should be the same.
The unassigned records is removed from the MBRROLE table. Use this command with SSL (Secure Sockets Layer) to ensure that the information are encrypted. To do so type the command with the HTTPS secure protocol.
The parameter URL and memberId are mandatory.
Behavior
- Calls an empty task command PreMemberRoleUnassignCmd. Store Developers can overwrite it change the input to the command.
- This command can unassign multiple roles for one member in one command call according to
different parameter combinations.
- memberId
- memberId&roledId
- memberId&roledId&orgEntityId
- memberId&roledId1&orgEntityId1&roleId2&orgEntityId2
- memberId&orgEntityId1
- memberId
- If memberId is specified alone, without any roleId or orgEntityId parameters, all the roles currently assigned to this member will be removed from all organizations.
- The roleId parameter takes the forms like roleId, roleId1, roleId2..., the corresponding orgEntityId should be orgEntityId, orgEntiyId1, orgEntityId2...
- If a roleId does not have corresponding orgEntityId, then the command will unassign this role from all orgEntities for this member.
- If an orgEntityId does have corresponding roleId, the command will unassign all roles this member played in this orgEntity.
- If unassign roles for an orgEntity and this orgEntity has descendants, this command will also unassign roles for its organization descendants.
- If unassign roles for a user, after assign roles, the command will check if the user is still a member of the SiteAdministrators group or the Administrators group. If not the command will update the RegisterType of this user to 'R'.
- If the command fails, the GenericApplicationError view command is called. Upon successful completion, the specified URL is called.
- Calls an empty task command PostMemberRoleUnassignCmd. Store Developers can overwrite it to perform additional operations.
Exception Conditions
- memberId is null (_ERR_CMD_MISSING_PARAM).
- memberId is not a valid orgEntityId or userId (_ERR_CMD_INVALID_PARAM).
- If memberId is an organization or organizational unit, if the corresponding orgEntityId(#) is specified but not equals to the memberId, an exception will be thrown (_ERR_INVALID_ORGENTITYID_IN_ROLEASSIGN). If the corresponding orgEntityId(#) is not specified, it will default to be the same as the memberId.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description static java.lang.String
CLASSNAME
The name of this implementation of the command.static java.lang.String
COPYRIGHT
IBM Copyright notice field.-
Fields inherited from interface com.ibm.commerce.usermanagement.commands.MemberRoleUnassignCmd
NAME
-
Fields inherited from interface com.ibm.commerce.command.ECCommand
defaultCommandClassName
-
-
Constructor Summary
Constructors Constructor and Description MemberRoleUnassignCmdImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description void
checkIsAllowed(AccessVector resource, java.lang.String action)
Performs resource-level access control on demand when roles are being unassigned for a user.boolean
getCheckURL()
Returns whether the URL parameter needs to be specified.java.lang.String
getMemberId()
Returns the member identifier of the member which is being unassigned from the specified role.java.util.Vector
getOrgEntities()
Returns a list of organization entity identifiers.AccessVector
getResources()
If roles are being unassigned for an organization, return that Organization as the resource.java.util.Vector
getRoles()
Returns the list of roles that the member is being unassigned from.TypedProperty
getViewInputProperties()
Returns the request properties without the tools framework objects.void
performExecute()
Unassigns the member from the specified member groups.void
reset()
Resets the parameters to their original state so the command object can be reused.void
setCheckURL(boolean abCheckURL)
Sets whether the URL needs to be specified.void
setMemberId(java.lang.String astrMemberId)
Sets the member identifier of the member that is being unassigned to the specified roles.void
setRequestProperties(TypedProperty reqProperties)
Sets the request properties by calling the ProcessRequestProperties command.void
validateParameters()
Validate the member and the roles specified.-
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl
checkPermission, fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResourceOwners, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties
-
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand
accessControlCheck, checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, execute, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getObjectSize, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, isReadyToCallExecute, setAccCheck, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from class com.ibm.websphere.command.CacheableCommandImpl
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, setObjectSize, unionDependencies, updateCache
-
Methods inherited from class com.ibm.websphere.command.TargetableCommandImpl
getCommandTarget, getCommandTargetName, getTargetPolicy, hasOutputProperties, setCommandTarget, setCommandTargetName, setHasOutputProperties, setOutputProperties, setTargetPolicy
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.ibm.commerce.command.ControllerCommand
checkPermission, execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties
-
Methods inherited from interface com.ibm.websphere.command.CacheableCommand
executeFromCache, getCaller, getEntryInfo, getId, getSharingPolicy, postExecute, preExecute, setCaller, updateCache
-
Methods inherited from interface com.ibm.websphere.command.TargetableCommand
getCommandTarget, getCommandTargetName, hasOutputProperties, setCommandTarget, setCommandTargetName, setOutputProperties
-
Methods inherited from interface com.ibm.commerce.command.AccCommand
accessControlCheck, getAccCheck, getForUserId, getResourceOwners, setAccCheck, setForUserId, setOwner
-
Methods inherited from interface com.ibm.commerce.command.ECCommand
checkIsAllowed, checkResourcePermission, createCommandExecutionEvent, getCommandContext, getCommandIfName, getCommandName, getCommandStoreId, getDefaultProperties, getExceptionInvokeParameters, getPostInvokeParameters, getPreInvokeParameters, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setCommandStoreId, setDefaultProperties
-
Methods inherited from interface com.ibm.commerce.security.Protectable
fulfills, getOwner
-
-
-
-
Field Detail
-
COPYRIGHT
public static final java.lang.String COPYRIGHT
IBM Copyright notice field.- See Also:
- Constant Field Values
-
CLASSNAME
public static final java.lang.String CLASSNAME
The name of this implementation of the command.- See Also:
- Constant Field Values
-
-
Method Detail
-
getCheckURL
public boolean getCheckURL()
Returns whether the URL parameter needs to be specified.- Specified by:
getCheckURL
in interfaceMemberRoleUnassignCmd
- Returns:
- Whether the URL parameter needs to be specified.
-
getMemberId
public java.lang.String getMemberId()
Returns the member identifier of the member which is being unassigned from the specified role.- Specified by:
getMemberId
in interfaceMemberRoleUnassignCmd
- Returns:
- The member identifier.
-
getOrgEntities
public java.util.Vector getOrgEntities()
Returns a list of organization entity identifiers.- Specified by:
getOrgEntities
in interfaceMemberRoleUnassignCmd
- Returns:
- A list or organization entity identifiers.
-
getResources
public AccessVector getResources() throws ECException
If roles are being unassigned for an organization, return that Organization as the resource. If roles are being unassigned for a user, check to see if the executor has appropriate resource level permissions on the organizations (where the role was being played).- Specified by:
getResources
in interfaceECCommand
- Overrides:
getResources
in classAbstractECTargetableCommand
- Returns:
- AccessVector containing organization resources where the roles are being played. When the memberId is a user, the default action is appended with "-User".
- Throws:
ECException
- if access is not allowed
-
getRoles
public java.util.Vector getRoles()
Returns the list of roles that the member is being unassigned from.- Specified by:
getRoles
in interfaceMemberRoleUnassignCmd
- Returns:
- The list of roles.
-
getViewInputProperties
public TypedProperty getViewInputProperties()
Returns the request properties without the tools framework objects.- Specified by:
getViewInputProperties
in interfaceControllerCommand
- Overrides:
getViewInputProperties
in classControllerCommandImpl
- Returns:
- The request properties without the tools framework objects.
-
performExecute
public void performExecute() throws ECException
Unassigns the member from the specified member groups. Then calls the PostMemberRoleUnassignCmd command to perform some customized function.- Specified by:
performExecute
in interfaceECCommand
- Specified by:
performExecute
in interfacecom.ibm.websphere.command.TargetableCommand
- Overrides:
performExecute
in classAbstractECTargetableCommand
- Throws:
ECException
- If there was a problem unassigning the member from the roles or a problem when executing the customize post command.
-
checkIsAllowed
public void checkIsAllowed(AccessVector resource, java.lang.String action) throws ECException
Performs resource-level access control on demand when roles are being unassigned for a user.- Parameters:
resource
- Access Vectoraction
- The action.- Throws:
Throws
- ECSystemException.ECException
-
reset
public void reset()
Resets the parameters to their original state so the command object can be reused.- Specified by:
reset
in interfaceMemberRoleUnassignCmd
- Specified by:
reset
in interfacecom.ibm.websphere.command.Command
- Overrides:
reset
in classAbstractECTargetableCommand
-
setCheckURL
public void setCheckURL(boolean abCheckURL)
Sets whether the URL needs to be specified.- Specified by:
setCheckURL
in interfaceMemberRoleUnassignCmd
- Parameters:
Whether
- the URL needs to be specified.
-
setMemberId
public void setMemberId(java.lang.String astrMemberId)
Sets the member identifier of the member that is being unassigned to the specified roles.- Specified by:
setMemberId
in interfaceMemberRoleUnassignCmd
- Parameters:
astrMemberId
- the member identifier.
-
setRequestProperties
public void setRequestProperties(TypedProperty reqProperties) throws ECException
Sets the request properties by calling the ProcessRequestProperties command. Then calls the PreMemberRoleUnassign command to preform any preprocessing before the command is executed.- Specified by:
setRequestProperties
in interfaceControllerCommand
- Overrides:
setRequestProperties
in classControllerCommandImpl
- Parameters:
reqProperties
- the parameters of the command.- Throws:
ECException
- If there is a problem with invalid or missing parameters or there was a problem reported by the PreMemberRoleUnassign command.
-
validateParameters
public void validateParameters() throws ECException
Validate the member and the roles specified.- Specified by:
validateParameters
in interfaceECCommand
- Overrides:
validateParameters
in classAbstractECTargetableCommand
- Throws:
ECException
- If any of the specified parameters are invalid.
-
-