Merge "Fix issue with user permission on package deletion"
This commit is contained in:
commit
b5ef1ea896
@ -210,7 +210,7 @@ class Controller(object):
|
|||||||
return package.archive
|
return package.archive
|
||||||
|
|
||||||
def delete(self, req, package_id):
|
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):
|
def show_categories(self, req):
|
||||||
categories = db_api.categories_list()
|
categories = db_api.categories_list()
|
||||||
|
@ -391,15 +391,16 @@ def package_upload(values, tenant_id):
|
|||||||
return package
|
return package
|
||||||
|
|
||||||
|
|
||||||
def package_delete(package_id):
|
def package_delete(package_id, context):
|
||||||
"""
|
"""
|
||||||
Delete package information from the system ID of a package, string
|
Delete package information from the system ID of a package, string
|
||||||
parameters to update
|
parameters to update
|
||||||
"""
|
"""
|
||||||
session = db_session.get_session()
|
session = db_session.get_session()
|
||||||
|
|
||||||
with session.begin():
|
with session.begin():
|
||||||
package = session.query(models.Package).get(package_id)
|
package = session.query(models.Package).get(package_id)
|
||||||
|
_authorize_package(package, context)
|
||||||
session.delete(package)
|
session.delete(package)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user