Пример #1
0
def package_relationship_delete(context, data_dict):
    can_edit_this_relationship = package_relationship_create(context, data_dict)
    if not can_edit_this_relationship['success']:
        return can_edit_this_relationship

    model = context['model']
    user = context['user']
    relationship = context['relationship']

    authorized = logic.check_access_old(relationship, model.Action.PURGE, context)
    if not authorized:
        return {'success': False, 'msg': _('User %s not authorized to delete relationship %s') % (str(user),relationship.id)}
    else:
        return {'success': True}
Пример #2
0
def package_relationship_delete(context, data_dict):
    can_edit_this_relationship = package_relationship_create(
        context, data_dict)
    if not can_edit_this_relationship['success']:
        return can_edit_this_relationship

    model = context['model']
    user = context['user']
    relationship = context['relationship']

    authorized = check_access_old(relationship, model.Action.PURGE, context)
    if not authorized:
        return {
            'success':
            False,
            'msg':
            _('User %s not authorized to delete relationship %s') %
            (str(user), relationship.id)
        }
    else:
        return {'success': True}
Пример #3
0
def package_relationship_update(context, data_dict):
    return package_relationship_create(context, data_dict)