Skip to content

Commit

Permalink
feat: [torrust#615] added Casbin enforcer to app state
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-nt committed Jun 17, 2024
1 parent 8bb91aa commit 0ab038c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,10 @@ pub async fn run(configuration: Configuration, api_version: &Version) -> Running
let torrent_tag_repository = Arc::new(DbTorrentTagRepository::new(database.clone()));
let torrent_listing_generator = Arc::new(DbTorrentListingGenerator::new(database.clone()));
let banned_user_list = Arc::new(DbBannedUserList::new(database.clone()));
let casbin_enforcer = Arc::new(authorization::CasbinEnforcer::new().await);

// Services
let authorization_service = Arc::new(authorization::Service::new(user_repository.clone()));
let authorization_service = Arc::new(authorization::Service::new(user_repository.clone(), casbin_enforcer.clone()));
let tracker_service = Arc::new(tracker::service::Service::new(configuration.clone(), database.clone()).await);
let tracker_statistics_importer =
Arc::new(StatisticsImporter::new(configuration.clone(), tracker_service.clone(), database.clone()).await);
Expand Down

0 comments on commit 0ab038c

Please sign in to comment.