api_config.yml 6.47 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# THIS FILE IS USED TO GENERATE OTHER VERY IMPORTANT FILES
# BOTH IN THE FRONTEND AND IN THE BACKEND !
# TAKE CARE WHEN MODYFING IT ;)

# model : the model name (may be null)
# viewset : the viewset name for the api
# api_end_pont : the main part of the url for making request to the api
#  This string will also be used for naming variables in JS !!
#  So no weird characters there please...
# versionned: boolean to specify wether this model is versionned or not
# api_attr : to specify some attributes that may be captured
#  and used in the viewset
# requires_testing: boolean to tell if this viewset is only availble in
#  a testing environment.

16
17
18
19
20
# Moderation levels are defined as follow :
#     0 : moderation will never be applied
#     1 : moderation will be on if the global settings for moderation is turned on
#     2 : (default for security reasons) moderation will always be on no matter what
# It is to be noted that staff members, dri members and moderators won't be subject to moderation !
Florent Chehab's avatar
Florent Chehab committed
21
22
23
24
#
# When moderation_level > 0, someone may decide to enforce moderation on for the users with a lower 
#   status in the app. This is called object level moderation ! 
#   staff ⊂ dri ⊂ moderators ⊂ authenficated_user 
25
26
27
28
29
30
31
32
33
34
35
36
37

# For viewset permissions we have the followings
# 
# By default, every viewset will have :
#     - isAuthentificated : to use the API the client needs to be authentificated
#     - noDeleteIsNotStaff : nothing can be deleted except if you are a staff member
#
# Some viewsets may have more presice permissions
#     - IsStaff
#     - IsStaffOrReadOnly
#     - IsDriOrReadOnly   
#     - IsOwner : (or )
# 
38

39
40
- model: Country
  viewset: CountryViewSet
41
  import_location: country
Florent Chehab's avatar
Florent Chehab committed
42
  api_end_point: countries
43
  viewset_permission: IsStaffOrReadOnly
44
45
46

- model: City
  viewset: CityViewSet
47
  import_location: city
Florent Chehab's avatar
Florent Chehab committed
48
  api_end_point: cities
49
  moderation_level: 2
50

Florent Chehab's avatar
Florent Chehab committed
51
52
- model: University
  viewset: UniversityViewSet
53
  import_location: university
Florent Chehab's avatar
Florent Chehab committed
54
  api_end_point: universities
55
  moderation_level: 2
56

Florent Chehab's avatar
Florent Chehab committed
57
58
- model: Campus
  viewset: CampusViewSet
59
  import_location: campus
Florent Chehab's avatar
Florent Chehab committed
60
  api_end_point: campuses
61
  versionned: true
62
  moderation_level: 2
63
64


Florent Chehab's avatar
Florent Chehab committed
65
66
67
- model: UserData
  viewset: UserDataViewSet
  import_location: user
68
  api_end_point: userData
Florent Chehab's avatar
Florent Chehab committed
69
  api_name: user-data-detail
70
71
  moderation_level: 0
  viewset_permission: IsOwner
Florent Chehab's avatar
Florent Chehab committed
72
73
74
75
76
77


- model: Tag
  viewset: TagViewSet
  import_location: tag
  api_end_point: tags
78
79
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
80

81
82
- model: Currency
  viewset: CurrencyViewSet
83
  import_location: currency
Florent Chehab's avatar
Florent Chehab committed
84
  api_end_point: currencies
85
86
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
87
88
89

- model: Department
  viewset: DepartmentViewSet
Florent Chehab's avatar
Florent Chehab committed
90
  import_location: other_core
Florent Chehab's avatar
Florent Chehab committed
91
  api_end_point: departments
92
93
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
94
95
96

- model: Specialty
  viewset: SpecialtyViewSet
Florent Chehab's avatar
Florent Chehab committed
97
  import_location: other_core
Florent Chehab's avatar
Florent Chehab committed
98
  api_end_point: specialties
99
100
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
101
102
103

- model: Semester
  viewset: SemesterViewSet
Florent Chehab's avatar
Florent Chehab committed
104
  import_location: other_core
Florent Chehab's avatar
Florent Chehab committed
105
  api_end_point: semesters
106
107
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
108
109
110

- model: Offer
  viewset: OfferViewSet
Florent Chehab's avatar
Florent Chehab committed
111
  import_location: other_core
Florent Chehab's avatar
Florent Chehab committed
112
  api_end_point: offers
113
114
  moderation_level: 2
  viewset_permission: IsStaffOrReadOnly
Florent Chehab's avatar
Florent Chehab committed
115
116
117
118


- model: CountryTaggedItem
  viewset: CountryTaggedItemViewSet
119
  import_location: country
120
  api_end_point: countriesTaggedItems
Florent Chehab's avatar
Florent Chehab committed
121
  versionned: true
122
123
124

- model: CountryScholarship
  viewset: CountryScholarshipViewSet
125
  import_location: country
126
  api_end_point: countriesScholarships
127
  versionned: true
128
129
130

- model: CountryDri
  viewset: CountryDriViewSet
131
  import_location: country
132
  api_end_point: countriesDri
133
  viewset_permission: IsDriOrReadOnly
134
  versionned: true
135
136


Florent Chehab's avatar
Florent Chehab committed
137
138
139

- model: CityTaggedItem
  viewset: CityTaggedItemViewSet
140
  import_location: city
141
  api_end_point: citiesTaggedItems
142
  versionned: true
143

Florent Chehab's avatar
Florent Chehab committed
144
145
146
147


- model: UniversityTaggedItem
  viewset: UniversityTaggedItemViewSet
148
  import_location: university
149
  api_end_point: universitiesTaggedItems
Florent Chehab's avatar
Florent Chehab committed
150
  versionned: true
151
152
153
154

- model: UniversityScholarship
  viewset: UniversityScholarshipViewSet
  import_location: university
155
  api_end_point: universitiesScholarships
156
  versionned: true
157
158
159
160

- model: UniversityInfo
  viewset: UniversityInfoViewSet
  import_location: university
161
  api_end_point: universitiesInfo
162
  versionned: true
163
164
165
166

- model: UniversitySemestersDates
  viewset: UniversitySemestersDatesViewSet
  import_location: university
167
  api_end_point: universitiesSemestersDates
168
  versionned: true
169
170
171
172

- model: UniversityDri
  viewset: UniversityDriViewSet
  import_location: university
173
  api_end_point: universitiesDri
174
  viewset_permission: IsDriOrReadOnly
175
  versionned: true
176

177
- model: null
178
179
  viewset: UniversityModulesViewSet
  import_location: university
180
  api_end_point: universitiesAll
181
182
183
  api_attr: (?P<univ_id>[0-9]+)
  api_name: university_details

Florent Chehab's avatar
Florent Chehab committed
184
185
186
187


- model: CampusTaggedItem
  viewset: CampusTaggedItemViewSet
188
  import_location: campus
189
  api_end_point: campusesTaggedItems
Florent Chehab's avatar
Florent Chehab committed
190
191
192
193
  versionned: true

- model: null
  viewset: MainCampusViewSet
194
  import_location: campus
195
  api_end_point: mainCampuses
Florent Chehab's avatar
Florent Chehab committed
196
197
198
199
  read_only: true



200
201
202
- model: Recommendation
  viewset: RecommendationViewSet
  import_location: user
203
  api_end_point: userRecommendations
204
  moderation_level: 0
205
206
207
208

- model: RecommendationList
  viewset: RecommendationListViewSet
  import_location: user
209
  api_end_point: userRecommendationLists
210
  moderation_level: 0
211
212
213
214

- model: PreviousDeparture
  viewset: PreviousDepartureViewSet
  import_location: user
215
  api_end_point: universitiesPreviousDepartures
216
  moderation_level: 2
217
218
219
220

- model: PreviousDepartureFeedback
  viewset: PreviousDepartureFeedbackViewSet
  import_location: user
221
  api_end_point: universitiesPreviousDepartureFeedback
Florent Chehab's avatar
Florent Chehab committed
222

223
224
225
226


- model: PendingModeration
  viewset: PendingModerationViewSet
227
  import_location: abstract.my_model
228
  api_end_point: pendingModeration
229
230
  viewset_permission: IsStaff

231
232
233

- model: Version
  viewset: VersionViewSet
234
  import_location: abstract.my_model
235
  api_end_point: versions
236
  api_attr: (?P<content_type_id>[0-9]+)/(?P<object_pk>[0-9A-Za-z]+)
237
  api_name: versionsList
238
  ignore_in_admin: true
239
240
241

- model: ForTestingModeration
  viewset: ForTestingModerationViewSet
242
  import_location: abstract.my_model
243
  api_end_point: test/moderation
244
  moderation_level: 1
245
246
247
248
  requires_testing: true

- model: ForTestingVersioning
  viewset: ForTestingVersioningViewSet
249
  import_location: abstract.my_model
250
  api_end_point: test/versioning
251
  moderation_level: 1
252
  requires_testing: true
253
  # versionned: true don't put it here, it is manually handled with @register decorator