Commit f8e7570 1 parent 1342dce commit f8e7570 Copy full SHA for f8e7570
File tree 2 files changed +8
-0
lines changed
2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ pub enum ACTION {
49
49
AddTorrent ,
50
50
GetCanonicalInfoHash ,
51
51
GenerateTorrentInfoListing ,
52
+ GetTorrentInfo ,
52
53
}
53
54
54
55
pub struct Service {
@@ -192,6 +193,7 @@ impl CasbinConfiguration {
192
193
admin, AddTorrent
193
194
admin, GetCanonicalInfoHash
194
195
admin, GenerateTorrentInfoListing
196
+ admin, GetTorrentInfo
195
197
registered, GetCategories
196
198
registered, GetImageByUrl
197
199
registered, GetPublicSettings
@@ -200,6 +202,7 @@ impl CasbinConfiguration {
200
202
registered, AddTorrent
201
203
registered, GetCanonicalInfoHash
202
204
registered, GenerateTorrentInfoListing
205
+ registered, GetTorrentInfo
203
206
guest, GetCategories
204
207
guest, GetTags
205
208
guest, GetAboutPage
@@ -208,6 +211,7 @@ impl CasbinConfiguration {
208
211
guest, GetTorrent
209
212
guest, GetCanonicalInfoHash
210
213
guest, GenerateTorrentInfoListing
214
+ guest, GetTorrentInfo
211
215
" ,
212
216
) ,
213
217
}
Original file line number Diff line number Diff line change @@ -333,6 +333,10 @@ impl Index {
333
333
info_hash : & InfoHash ,
334
334
opt_user_id : Option < UserId > ,
335
335
) -> Result < TorrentResponse , ServiceError > {
336
+ self . authorization_service
337
+ . authorize ( ACTION :: GetTorrentInfo , opt_user_id)
338
+ . await ?;
339
+
336
340
let torrent_listing = self . torrent_listing_generator . one_torrent_by_info_hash ( info_hash) . await ?;
337
341
338
342
let torrent_response = self
You can’t perform that action at this time.
0 commit comments