File tree Expand file tree Collapse file tree 2 files changed +8
-0
lines changed
Expand file tree Collapse file tree 2 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -49,6 +49,7 @@ pub enum ACTION {
4949 AddTorrent ,
5050 GetCanonicalInfoHash ,
5151 GenerateTorrentInfoListing ,
52+ GetTorrentInfo ,
5253}
5354
5455pub struct Service {
@@ -192,6 +193,7 @@ impl CasbinConfiguration {
192193 admin, AddTorrent
193194 admin, GetCanonicalInfoHash
194195 admin, GenerateTorrentInfoListing
196+ admin, GetTorrentInfo
195197 registered, GetCategories
196198 registered, GetImageByUrl
197199 registered, GetPublicSettings
@@ -200,6 +202,7 @@ impl CasbinConfiguration {
200202 registered, AddTorrent
201203 registered, GetCanonicalInfoHash
202204 registered, GenerateTorrentInfoListing
205+ registered, GetTorrentInfo
203206 guest, GetCategories
204207 guest, GetTags
205208 guest, GetAboutPage
@@ -208,6 +211,7 @@ impl CasbinConfiguration {
208211 guest, GetTorrent
209212 guest, GetCanonicalInfoHash
210213 guest, GenerateTorrentInfoListing
214+ guest, GetTorrentInfo
211215 " ,
212216 ) ,
213217 }
Original file line number Diff line number Diff line change @@ -333,6 +333,10 @@ impl Index {
333333 info_hash : & InfoHash ,
334334 opt_user_id : Option < UserId > ,
335335 ) -> Result < TorrentResponse , ServiceError > {
336+ self . authorization_service
337+ . authorize ( ACTION :: GetTorrentInfo , opt_user_id)
338+ . await ?;
339+
336340 let torrent_listing = self . torrent_listing_generator . one_torrent_by_info_hash ( info_hash) . await ?;
337341
338342 let torrent_response = self
You can’t perform that action at this time.
0 commit comments