mirror of
https://github.com/openkmip/pykmip
synced 2025-12-28 06:03:22 +00:00
Add SetAttribute support to the server
This change adds SetAttribute operation support to the PyKMIP server, including additional attribute policy functionality to check for certain attribute characteristics that preclude SetAttribute operation functionality. Specifically, the operation cannot set the value of any multivalued attribute nor the value of any attribute not modifiable by the client. New unit tests have been added to cover these changes. Partially implements #547
This commit is contained in:
committed by
Peter Hamilton
parent
e313731692
commit
3be219144a
@@ -1155,6 +1155,20 @@ class AttributePolicy(object):
|
||||
rule_set = self._attribute_rule_sets.get(attribute)
|
||||
return rule_set.deletable_by_client
|
||||
|
||||
def is_attribute_modifiable_by_client(self, attribute):
|
||||
"""
|
||||
Check if the attribute can be modified by the client.
|
||||
|
||||
Args:
|
||||
attribute (string): The name of the attribute (e.g., "Name").
|
||||
|
||||
Returns:
|
||||
bool: True if the attribute can be modified by the client. False
|
||||
otherwise.
|
||||
"""
|
||||
rule_set = self._attribute_rule_sets.get(attribute)
|
||||
return rule_set.modifiable_by_client
|
||||
|
||||
def is_attribute_applicable_to_object_type(self, attribute, object_type):
|
||||
"""
|
||||
Check if the attribute is supported by the given object type.
|
||||
|
||||
Reference in New Issue
Block a user