Class MemberRoleUnassignCmdImpl

  • All Implemented Interfaces:
    AccCommand, ControllerCommand, ECCommand, ECTargetableCommand, Protectable, MemberRoleUnassignCmd,,,,,,

    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.


    • 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
    • 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 Detail


        public static final java.lang.String COPYRIGHT
        IBM Copyright notice field.
        See Also:
        Constant Field Values

        public static final java.lang.String CLASSNAME
        The name of this implementation of the command.
        See Also:
        Constant Field Values
    • Constructor Detail

      • MemberRoleUnassignCmdImpl

        public MemberRoleUnassignCmdImpl()
    • Method Detail

      • getCheckURL

        public boolean getCheckURL()
        Returns whether the URL parameter needs to be specified.
        Specified by:
        getCheckURL in interface MemberRoleUnassignCmd
        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 interface MemberRoleUnassignCmd
        The member identifier.
      • getOrgEntities

        public java.util.Vector getOrgEntities()
        Returns a list of organization entity identifiers.
        Specified by:
        getOrgEntities in interface MemberRoleUnassignCmd
        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 interface ECCommand
        getResources in class AbstractECTargetableCommand
        AccessVector containing organization resources where the roles are being played. When the memberId is a user, the default action is appended with "-User".
        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 interface MemberRoleUnassignCmd
        The list of roles.
      • 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 interface ECCommand
        Specified by:
        performExecute in interface
        performExecute in class AbstractECTargetableCommand
        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.
        resource - Access Vector
        action - The action.
        Throws - ECSystemException.
      • reset

        public void reset()
        Resets the parameters to their original state so the command object can be reused.
        Specified by:
        reset in interface MemberRoleUnassignCmd
        Specified by:
        reset in interface
        reset in class AbstractECTargetableCommand
      • setCheckURL

        public void setCheckURL(boolean abCheckURL)
        Sets whether the URL needs to be specified.
        Specified by:
        setCheckURL in interface MemberRoleUnassignCmd
        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 interface MemberRoleUnassignCmd
        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 interface ControllerCommand
        setRequestProperties in class ControllerCommandImpl
        reqProperties - the parameters of the command.
        ECException - If there is a problem with invalid or missing parameters or there was a problem reported by the PreMemberRoleUnassign command.