@@ -62,7 +62,7 @@ const MAX_OBJECT_STORE_REQUESTS: usize = 1000;
6262// const PERMISSIONS_WRITE: &str = "writeonly";
6363// const PERMISSIONS_DELETE: &str = "delete";
6464// const PERMISSIONS_READ_WRITE: &str = "readwrite";
65- const PERMISSIONS_ALL : & str = "all" ;
65+ const ACCESS_ALL : & str = "all" ;
6666
6767#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
6868pub struct ObjectStoreFormat {
@@ -72,7 +72,7 @@ pub struct ObjectStoreFormat {
7272 #[ serde( rename = "created-at" ) ]
7373 pub created_at : String ,
7474 pub owner : Owner ,
75- pub access : Access ,
75+ pub permissions : Vec < Permisssion > ,
7676}
7777
7878#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
@@ -88,29 +88,18 @@ impl Owner {
8888}
8989
9090#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
91- pub struct Access {
92- pub objects : Vec < AccessObject > ,
93- }
94-
95- impl Access {
96- pub fn new ( objects : Vec < AccessObject > ) -> Self {
97- Self { objects }
98- }
99- }
100-
101- #[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
102- pub struct AccessObject {
91+ pub struct Permisssion {
10392 pub id : String ,
10493 pub group : String ,
105- pub permissions : Vec < String > ,
94+ pub access : Vec < String > ,
10695}
10796
108- impl AccessObject {
97+ impl Permisssion {
10998 pub fn new ( id : String ) -> Self {
11099 Self {
111100 id : id. clone ( ) ,
112101 group : id,
113- permissions : vec ! [ PERMISSIONS_ALL . to_string( ) ] ,
102+ access : vec ! [ ACCESS_ALL . to_string( ) ] ,
114103 }
115104 }
116105}
@@ -122,7 +111,7 @@ impl Default for ObjectStoreFormat {
122111 objectstore_format : "v1" . to_string ( ) ,
123112 created_at : Local :: now ( ) . to_rfc3339 ( ) ,
124113 owner : Owner :: new ( "" . to_string ( ) , "" . to_string ( ) ) ,
125- access : Access :: new ( vec ! [ ] ) ,
114+ permissions : vec ! [ Permisssion :: new( "parseable" . to_string ( ) ) ] ,
126115 }
127116 }
128117}
@@ -132,9 +121,6 @@ impl ObjectStoreFormat {
132121 self . owner . id . clone_from ( & id) ;
133122 self . owner . group = id;
134123 }
135- fn set_access ( & mut self , access : Vec < AccessObject > ) {
136- self . access . objects = access;
137- }
138124}
139125
140126pub async fn resolve_parseable_metadata ( ) -> Result < ( ) , ObjectStorageError > {
0 commit comments