def put(self, action_alias, ref_or_id, requester_user):
        """
        Update an action alias.

        Handles requests:
            PUT /actionalias/1
        """
        action_alias_db = self._get_by_ref_or_id(ref_or_id=ref_or_id)
        LOG.debug(
            "PUT /actionalias/ lookup with id=%s found object: %s",
            ref_or_id,
            action_alias_db,
        )

        permission_type = PermissionType.ACTION_ALIAS_MODIFY
        rbac_utils = get_rbac_backend().get_utils_class()
        rbac_utils.assert_user_has_resource_db_permission(
            user_db=requester_user,
            resource_db=action_alias_db,
            permission_type=permission_type,
        )

        if not hasattr(action_alias, "id"):
            action_alias.id = None

        try:
            if (
                action_alias.id is not None
                and action_alias.id != ""
                and action_alias.id != ref_or_id
            ):
                LOG.warning(
                    "Discarding mismatched id=%s found in payload and using uri_id=%s.",
                    action_alias.id,
                    ref_or_id,
                )
            old_action_alias_db = action_alias_db
            action_alias_db = ActionAliasAPI.to_model(action_alias)
            action_alias_db.id = ref_or_id
            action_alias_db = ActionAlias.add_or_update(action_alias_db)
        except (ValidationError, ValueError) as e:
            LOG.exception("Validation failed for action alias data=%s", action_alias)
            abort(http_client.BAD_REQUEST, six.text_type(e))
            return

        extra = {
            "old_action_alias_db": old_action_alias_db,
            "new_action_alias_db": action_alias_db,
        }
        LOG.audit(
            "Action alias updated. ActionAlias.id=%s." % (action_alias_db.id),
            extra=extra,
        )
        action_alias_api = ActionAliasAPI.from_model(action_alias_db)

        return action_alias_api

        Update an action alias.

        Handles requests:
            PUT /actionalias/1
        
st2api/st2api/controllers/v1/actionalias.py