com.ibm.commerce.usermanagement.commands

Interface MemberRoleAssignCmd

  • All Superinterfaces:
    AccCommand, com.ibm.websphere.command.CacheableCommand, com.ibm.websphere.command.Command, com.ibm.websphere.command.CommandCaller, ControllerCommand, ECCommand, Protectable, java.io.Serializable, com.ibm.websphere.command.TargetableCommand
    All Known Implementing Classes:
    MemberRoleAssignCmdImpl


    public interface MemberRoleAssignCmd
    extends ControllerCommand
    Assigns roles to a member in the context of an organizational entity. The member can be a user, organization or organizational unit.

    Assigning roles to an organizational entity controls what roles other users can have in this organizational entity. An organizational entity can only have a role if its parent organizational entity has that role. When assigning a role to an organizational entity, the memberId and organEntityId should be same.

    The assignment is stored in 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 parameters URL and memberId are mandatory.

    Behavior

    • Calls an empty task command PreMemberRoleAssignCmd. Store Developers can overwrite it change the input to the command.
    • This command can assign multiple roles for one member in one command call according to different parameter combination.
    • The roleId parameter takes the forms like roleId, roleId1, roleId2..., the corresponding orgEntityId should be orgEntityId, orgEntiyId1, orgEntityId2...
    • If unassign roles for a user, after assign roles, the command will check if the user is a member of the SiteAdministrators group. If so, update RegisterType with an 'S'. If not, then check if the user is a member of the Administrators group. If so, update the RegisterType with an 'A'.
    • If the command fails, the GenericApplicationError view command is called. Upon successful completion, the specified URL is called.
    • Calls an empty task command PostMemberRoleAssignCmd. 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).
    • roleId(#) is not valid (_ERR_CMD_INVALID_PARAM).
    • The parent of the member does not have the role. A member can only be assigned a role if its parent has been assigned the same role (_ERR_PARENT_NOT_IN_ROLE).
    • If memberId is a user, then for each roleId(#), the corresponding orgEntityId(#) should be specified, otherwise, an exception will be thrown (_ERR_CMD_MISSING_PARAM).
    • If memberId is an orgEntity, 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.
    • Method Detail

      • getCheckURL

        boolean getCheckURL()
        Gets indicator which indicates whether or not the command will check URL parameter.
        Returns:
        boolean The indicator indicates whether or not the command will check URL parameter
        • true - This command will check URL parameter
        • false - This command will not check URL parameter
      • getMemberId

        java.lang.String getMemberId()
        Gets the memberId of the user or organization entities to assign roles.
        Returns:
        The memberId
      • getOrgEntities

        java.util.Vector getOrgEntities()
        Gets a vector which contains all orgEntityIds (Long) for roles to assign. These orgEntityIds are get from requestProperties. For each roleId, there is a corresponding orgEntityId.
        Returns:
        java.util.Vector A vector which contains all orgEntityIds (Long) for roles to assigns
      • getRoles

        java.util.Vector getRoles()
        Gets a vector which contains all roleIds (Integer) to be assigned. These roleIds are get from requestProperties. For each roleId, there is a corresponding orgEntityId.
        Returns:
        java.util.Vector A vector which contains all roleIds (Integer) to be assigned
      • reset

        void reset()
        Resets all instance variables of the command to initial state so it can be used again.
        Specified by:
        reset in interface com.ibm.websphere.command.Command
      • setCheckURL

        void setCheckURL(boolean abCheckURL)
        Sets whether or not this command will check URL parameter.
        Parameters:
        abCheckURL - boolean
        • true - This command will check URL parameter
        • false - This command will not check URL parameter
      • setMemberId

        void setMemberId(java.lang.String astrMemberId)
        Sets the memberId of the user or orgEntities to assign roles.
        Parameters:
        astrMemberId - The memberId