@@ -35,7 +35,7 @@ const register = async function (server) {
35
35
} ) ,
36
36
} ,
37
37
handler : ( request , h ) => organizationAdminController . getOrganizationDetails ( request , h ) ,
38
- tags : [ 'api' , 'organizations' ] ,
38
+ tags : [ 'api' , 'admin' , 'organizational-entities' , ' organizations'] ,
39
39
notes : [
40
40
"- **Cette route est restreinte aux utilisateurs authentifiés ayant les droits d'accès**\n" +
41
41
'- Elle permet de récupérer toutes les informations d’une organisation' ,
@@ -74,13 +74,41 @@ const register = async function (server) {
74
74
} ,
75
75
} ,
76
76
handler : ( request , h ) => organizationAdminController . updateOrganizationInformation ( request , h ) ,
77
- tags : [ 'api' , 'organizations' ] ,
77
+ tags : [ 'api' , 'admin' , 'organizational-entities' , ' organizations'] ,
78
78
notes : [
79
79
"- **Cette route est restreinte aux utilisateurs authentifiés ayant les droits d'accès**\n" +
80
80
'- Elle permet de mettre à jour tout ou partie d’une organisation' ,
81
81
] ,
82
82
} ,
83
83
} ,
84
+ {
85
+ method : 'POST' ,
86
+ path : '/api/admin/organizations/{id}/archive' ,
87
+ config : {
88
+ pre : [
89
+ {
90
+ method : ( request , h ) =>
91
+ securityPreHandlers . hasAtLeastOneAccessOf ( [
92
+ securityPreHandlers . checkAdminMemberHasRoleSuperAdmin ,
93
+ securityPreHandlers . checkAdminMemberHasRoleSupport ,
94
+ securityPreHandlers . checkAdminMemberHasRoleMetier ,
95
+ ] ) ( request , h ) ,
96
+ assign : 'hasAuthorizationToAccessAdminScope' ,
97
+ } ,
98
+ ] ,
99
+ validate : {
100
+ params : Joi . object ( {
101
+ id : identifiersType . organizationId ,
102
+ } ) ,
103
+ } ,
104
+ handler : organizationAdminController . archiveOrganization ,
105
+ tags : [ 'api' , 'admin' , 'organizational-entities' , 'organizations' ] ,
106
+ notes : [
107
+ "- **Cette route est restreinte aux utilisateurs authentifiés ayant les droits d'accès**\n" +
108
+ "- Elle permet d'archiver une organisation" ,
109
+ ] ,
110
+ } ,
111
+ } ,
84
112
{
85
113
method : 'POST' ,
86
114
path : '/api/admin/organizations/{organizationId}/attach-child-organization' ,
0 commit comments