Merge "Fix issue with user permission on package deletion"

This commit is contained in:
Jenkins 2014-04-29 14:34:54 +00:00 committed by Gerrit Code Review
commit b5ef1ea896
2 changed files with 4 additions and 3 deletions

View File

@ -210,7 +210,7 @@ class Controller(object):
return package.archive
def delete(self, req, package_id):
db_api.package_delete(package_id)
db_api.package_delete(package_id, req.context)
def show_categories(self, req):
categories = db_api.categories_list()

View File

@ -391,15 +391,16 @@ def package_upload(values, tenant_id):
return package
def package_delete(package_id):
def package_delete(package_id, context):
"""
Delete package information from the system ID of a package, string
parameters to update
"""
session = db_session.get_session()
with session.begin():
package = session.query(models.Package).get(package_id)
_authorize_package(package, context)
session.delete(package)