'delete( self, trans, encoded_dataset_id, **kwd ):
* DELETE /api/libraries/datasets/{encoded_dataset_id}
Marks the dataset deleted or undeleted based on the value
of the undelete flag.
If the flag is not present it is considered False and the
item is marked deleted.
:param  encoded_dataset_id:      the encoded id of the dataset to change
:type   encoded_dataset_id:      an encoded id string
:returns:   dict containing information about the dataset
:rtype:     dictionary'

@expose_api
def delete(self, trans, encoded_dataset_id, **kwd):

    undelete = util.string_as_bool(kwd.get('undelete', False))
    try:
        dataset = self.get_library_dataset(trans, id=encoded_dataset_id, check_ownership=False, check_accessible=False)
    except Exception as e:
        raise exceptions.ObjectNotFound(('Requested    dataset    was    not    found.' + str(e)))
    current_user_roles = trans.get_current_user_roles()
    allowed = trans.app.security_agent.can_modify_library_item(current_user_roles, dataset)
    if ((not allowed) and (not trans.user_is_admin())):
        raise exceptions.InsufficientPermissionsException('You    do    not    have    proper    permissions    to    delete    this    dataset.')
    if undelete:
        dataset.deleted = False
    else:
        dataset.deleted = True
    trans.sa_session.add(dataset)
    trans.sa_session.flush()
    rval = trans.security.encode_all_ids(dataset.to_dict())
    nice_size = util.nice_size(int(dataset.library_dataset_dataset_association.get_size()))
    rval['file_size'] = nice_size
    rval['update_time'] = dataset.update_time.strftime('%Y-%m-%d    %I:%M    %p')
    rval['deleted'] = dataset.deleted
    rval['folder_id'] = ('F' + rval['folder_id'])
    return rval
