Revision 3dabe5d2 kamaki/cli/commands/pithos_cli.py
b/kamaki/cli/commands/pithos_cli.py | ||
---|---|---|
899 | 899 |
|
900 | 900 |
|
901 | 901 |
@command() |
902 |
class store_permitions(_store_container_command):
|
|
903 |
"""Get object read/write permitions"""
|
|
902 |
class store_permissions(_store_container_command):
|
|
903 |
"""Get object read/write permissions """
|
|
904 | 904 |
|
905 | 905 |
def main(self, container___path): |
906 | 906 |
super(self.__class__, |
... | ... | |
913 | 913 |
|
914 | 914 |
|
915 | 915 |
@command() |
916 |
class store_setpermitions(_store_container_command):
|
|
917 |
"""Set sharing permitions"""
|
|
916 |
class store_setpermissions(_store_container_command):
|
|
917 |
"""Set sharing permissions """
|
|
918 | 918 |
|
919 |
def format_permition_dict(self, permitions):
|
|
919 |
def format_permition_dict(self, permissions):
|
|
920 | 920 |
read = False |
921 | 921 |
write = False |
922 |
for perms in permitions:
|
|
922 |
for perms in permissions:
|
|
923 | 923 |
splstr = perms.split('=') |
924 | 924 |
if 'read' == splstr[0]: |
925 | 925 |
read = [user_or_group.strip() \ |
... | ... | |
935 | 935 |
message='Usage:\tread=<groups,users> write=<groups,users>') |
936 | 936 |
return (read, write) |
937 | 937 |
|
938 |
def main(self, container___path, *permitions):
|
|
938 |
def main(self, container___path, *permissions):
|
|
939 | 939 |
super(self.__class__, |
940 | 940 |
self).main(container___path, path_is_optional=False) |
941 |
(read, write) = self.format_permition_dict(permitions)
|
|
941 |
(read, write) = self.format_permition_dict(permissions)
|
|
942 | 942 |
try: |
943 | 943 |
self.client.set_object_sharing(self.path, |
944 | 944 |
read_permition=read, write_permition=write) |
... | ... | |
947 | 947 |
|
948 | 948 |
|
949 | 949 |
@command() |
950 |
class store_delpermitions(_store_container_command):
|
|
951 |
"""Delete all sharing permitions"""
|
|
950 |
class store_delpermissions(_store_container_command):
|
|
951 |
"""Delete all sharing permissions"""
|
|
952 | 952 |
|
953 | 953 |
def main(self, container___path): |
954 | 954 |
super(self.__class__, |
Also available in: Unified diff