@@ -62,7 +62,7 @@ const MAX_OBJECT_STORE_REQUESTS: usize = 1000;
62
62
// const PERMISSIONS_WRITE: &str = "writeonly";
63
63
// const PERMISSIONS_DELETE: &str = "delete";
64
64
// const PERMISSIONS_READ_WRITE: &str = "readwrite";
65
- const PERMISSIONS_ALL : & str = "all" ;
65
+ const ACCESS_ALL : & str = "all" ;
66
66
67
67
#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
68
68
pub struct ObjectStoreFormat {
@@ -72,7 +72,7 @@ pub struct ObjectStoreFormat {
72
72
#[ serde( rename = "created-at" ) ]
73
73
pub created_at : String ,
74
74
pub owner : Owner ,
75
- pub access : Access ,
75
+ pub permissions : Vec < Permisssion > ,
76
76
}
77
77
78
78
#[ derive( Debug , Clone , PartialEq , Eq , Serialize , Deserialize ) ]
@@ -88,29 +88,18 @@ impl Owner {
88
88
}
89
89
90
90
#[ 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 {
103
92
pub id : String ,
104
93
pub group : String ,
105
- pub permissions : Vec < String > ,
94
+ pub access : Vec < String > ,
106
95
}
107
96
108
- impl AccessObject {
97
+ impl Permisssion {
109
98
pub fn new ( id : String ) -> Self {
110
99
Self {
111
100
id : id. clone ( ) ,
112
101
group : id,
113
- permissions : vec ! [ PERMISSIONS_ALL . to_string( ) ] ,
102
+ access : vec ! [ ACCESS_ALL . to_string( ) ] ,
114
103
}
115
104
}
116
105
}
@@ -122,7 +111,7 @@ impl Default for ObjectStoreFormat {
122
111
objectstore_format : "v1" . to_string ( ) ,
123
112
created_at : Local :: now ( ) . to_rfc3339 ( ) ,
124
113
owner : Owner :: new ( "" . to_string ( ) , "" . to_string ( ) ) ,
125
- access : Access :: new ( vec ! [ ] ) ,
114
+ permissions : vec ! [ Permisssion :: new( "parseable" . to_string ( ) ) ] ,
126
115
}
127
116
}
128
117
}
@@ -132,9 +121,6 @@ impl ObjectStoreFormat {
132
121
self . owner . id . clone_from ( & id) ;
133
122
self . owner . group = id;
134
123
}
135
- fn set_access ( & mut self , access : Vec < AccessObject > ) {
136
- self . access . objects = access;
137
- }
138
124
}
139
125
140
126
pub async fn resolve_parseable_metadata ( ) -> Result < ( ) , ObjectStorageError > {
0 commit comments