@@ -213,28 +213,35 @@ impl ProxyRole {
213213/// Extrinsics which require previous authorization to call them
214214#[ derive( Encode , Decode , Clone , Eq , PartialEq , RuntimeDebugNoBound , MaxEncodedLen , TypeInfo , Copy ) ]
215215pub enum ProxyPermission {
216- RegisterUser , // users_register_user
217- UpdateUser , // users_update_user
218- DeleteUser , // users_delete_user
216+ RegisterUser , // users
217+ EditUser , // users_edit_user
219218 CreateProject , // projects_create_project
220219 EditProject , // projects_edit_project
221220 DeleteProject , // projects_delete_project
222221 AssignUser , // projects_assign_user
223- UnassignUser , // projects_unassign_user
222+ Expenditures , // expenditures
223+ SubmitDrawdown , // submit_drawdown
224+ ApproveDrawdown , // approve_drawdown
225+ RejectDrawdown , // reject_drawdown
226+ UpBulkupload , // up_bulkupload
227+ Inflation , // inflation
224228}
225229
226230impl ProxyPermission {
227231 pub fn to_vec ( self ) -> Vec < u8 > {
228232 match self {
229233 Self :: RegisterUser => "RegisterUser" . as_bytes ( ) . to_vec ( ) ,
230- Self :: UpdateUser => "UpdateUser" . as_bytes ( ) . to_vec ( ) ,
231- Self :: DeleteUser => "DeleteUser" . as_bytes ( ) . to_vec ( ) ,
234+ Self :: EditUser => "EditUser" . as_bytes ( ) . to_vec ( ) ,
232235 Self :: CreateProject => "CreateProject" . as_bytes ( ) . to_vec ( ) ,
233236 Self :: EditProject => "EditProject" . as_bytes ( ) . to_vec ( ) ,
234237 Self :: DeleteProject => "DeleteProject" . as_bytes ( ) . to_vec ( ) ,
235238 Self :: AssignUser => "AssignUser" . as_bytes ( ) . to_vec ( ) ,
236- Self :: UnassignUser => "UnassignUser" . as_bytes ( ) . to_vec ( ) ,
237-
239+ Self :: Expenditures => "Expenditures" . as_bytes ( ) . to_vec ( ) ,
240+ Self :: SubmitDrawdown => "SubmitDrawdown" . as_bytes ( ) . to_vec ( ) ,
241+ Self :: ApproveDrawdown => "ApproveDrawdown" . as_bytes ( ) . to_vec ( ) ,
242+ Self :: RejectDrawdown => "RejectDrawdown" . as_bytes ( ) . to_vec ( ) ,
243+ Self :: UpBulkupload => "UpBulkupload" . as_bytes ( ) . to_vec ( ) ,
244+ Self :: Inflation => "Inflation" . as_bytes ( ) . to_vec ( ) ,
238245 }
239246 }
240247
@@ -247,23 +254,31 @@ impl ProxyPermission {
247254 //TODO: change it to mut when add new roles
248255 let administrator_permissions = [
249256 RegisterUser . to_vec ( ) ,
250- UpdateUser . to_vec ( ) ,
251- DeleteUser . to_vec ( ) ,
257+ EditUser . to_vec ( ) ,
252258 CreateProject . to_vec ( ) ,
253259 EditProject . to_vec ( ) ,
254260 DeleteProject . to_vec ( ) ,
255261 AssignUser . to_vec ( ) ,
256- UnassignUser . to_vec ( ) ,
262+ Expenditures . to_vec ( ) ,
263+ SubmitDrawdown . to_vec ( ) ,
264+ ApproveDrawdown . to_vec ( ) ,
265+ RejectDrawdown . to_vec ( ) ,
266+ UpBulkupload . to_vec ( ) ,
267+ Inflation . to_vec ( ) ,
257268 ] . to_vec ( ) ;
258269 administrator_permissions
259270 }
260271
261- // pub fn developer_permissions() -> Vec<Vec<u8>>{
262- // //use crate::types::ProxyPermission::*;
263- // let developer_permissions = [
264- // ].to_vec();
265- // developer_permissions
266- // }
272+ pub fn developer_permissions ( ) -> Vec < Vec < u8 > > {
273+ use crate :: types:: ProxyPermission :: * ;
274+ let developer_permissions = [
275+ EditUser . to_vec ( ) ,
276+ SubmitDrawdown . to_vec ( ) ,
277+
278+
279+ ] . to_vec ( ) ;
280+ developer_permissions
281+ }
267282
268283
269284}
0 commit comments