Skip to content

Commit

Permalink
feat: [#615] authorization implemented for get tags method
Browse files Browse the repository at this point in the history
  • Loading branch information
mario-nt committed Aug 3, 2024
1 parent eee3349 commit cd8f609
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/services/authorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ pub enum ACTION {
BanUser,
GetAboutPage,
GetLicensePage,
GetTags,
}

pub struct Service {
Expand Down Expand Up @@ -179,6 +180,7 @@ impl CasbinConfiguration {
admin, BanUser
guest, GetAboutPage
guest, GetLicensePage
guest, GetTags
",
),
}
Expand Down
2 changes: 1 addition & 1 deletion src/web/api/server/v1/contexts/tag/handlers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::web::api::server::v1::responses::{self};
/// It returns an error if there is a database error.
#[allow(clippy::unused_async)]
pub async fn get_all_handler(State(app_data): State<Arc<AppData>>) -> Response {
match app_data.tag_repository.get_all().await {
match app_data.tag_service.get_tags().await {
Ok(tags) => Json(responses::OkResponseData { data: tags }).into_response(),
Err(error) => error.into_response(),
}
Expand Down

0 comments on commit cd8f609

Please sign in to comment.