mirror of https://github.com/OpenKMIP/PyKMIP.git
Merge pull request #438 from OpenKMIP/feat/update-access-denied-error
Raise PermissionDenied on access control violations
This commit is contained in:
commit
b878dbfdf9
|
@ -938,7 +938,7 @@ class KmipEngine(object):
|
||||||
operation
|
operation
|
||||||
)
|
)
|
||||||
if not is_allowed:
|
if not is_allowed:
|
||||||
raise exceptions.ItemNotFound(
|
raise exceptions.PermissionDenied(
|
||||||
"Could not locate object: {0}".format(uid)
|
"Could not locate object: {0}".format(uid)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -2376,7 +2376,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
args = [id_a, enums.Operation.GET]
|
args = [id_a, enums.Operation.GET]
|
||||||
six.assertRaisesRegex(
|
six.assertRaisesRegex(
|
||||||
self,
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.PermissionDenied,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._get_object_with_access_controls,
|
e._get_object_with_access_controls,
|
||||||
*args
|
*args
|
||||||
|
@ -4659,7 +4659,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
args = [payload]
|
args = [payload]
|
||||||
six.assertRaisesRegex(
|
six.assertRaisesRegex(
|
||||||
self,
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.PermissionDenied,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._process_get,
|
e._process_get,
|
||||||
*args
|
*args
|
||||||
|
@ -5505,7 +5505,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
# be retrieved.
|
# be retrieved.
|
||||||
args = [payload]
|
args = [payload]
|
||||||
self.assertRaisesRegex(
|
self.assertRaisesRegex(
|
||||||
exceptions.ItemNotFound,
|
exceptions.PermissionDenied,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._process_get_attributes,
|
e._process_get_attributes,
|
||||||
*args
|
*args
|
||||||
|
@ -5694,7 +5694,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
# be retrieved.
|
# be retrieved.
|
||||||
args = [payload]
|
args = [payload]
|
||||||
self.assertRaisesRegex(
|
self.assertRaisesRegex(
|
||||||
exceptions.ItemNotFound,
|
exceptions.PermissionDenied,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._process_get_attribute_list,
|
e._process_get_attribute_list,
|
||||||
*args
|
*args
|
||||||
|
@ -5876,7 +5876,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
# Test by specifying the ID of the object to activate.
|
# Test by specifying the ID of the object to activate.
|
||||||
args = [payload]
|
args = [payload]
|
||||||
self.assertRaisesRegex(
|
self.assertRaisesRegex(
|
||||||
exceptions.ItemNotFound,
|
exceptions.PermissionDenied,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._process_activate,
|
e._process_activate,
|
||||||
*args
|
*args
|
||||||
|
@ -6197,7 +6197,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
|
|
||||||
args = [payload]
|
args = [payload]
|
||||||
self.assertRaisesRegex(
|
self.assertRaisesRegex(
|
||||||
exceptions.ItemNotFound,
|
exceptions.PermissionDenied,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._process_revoke,
|
e._process_revoke,
|
||||||
*args
|
*args
|
||||||
|
@ -6340,7 +6340,7 @@ class TestKmipEngine(testtools.TestCase):
|
||||||
args = [payload]
|
args = [payload]
|
||||||
six.assertRaisesRegex(
|
six.assertRaisesRegex(
|
||||||
self,
|
self,
|
||||||
exceptions.ItemNotFound,
|
exceptions.PermissionDenied,
|
||||||
"Could not locate object: {0}".format(id_a),
|
"Could not locate object: {0}".format(id_a),
|
||||||
e._process_destroy,
|
e._process_destroy,
|
||||||
*args
|
*args
|
||||||
|
|
Loading…
Reference in New Issue