Skip to content

Commit

Permalink
fix: GET rbac permission for settings (#3368)
Browse files Browse the repository at this point in the history
  • Loading branch information
Subhra264 committed May 17, 2024
1 parent 9a6ab4d commit 90cc1b2
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/common/utils/auth.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,11 @@ impl FromRequest for AuthExtractor {
path_columns[0].to_string()
}
} else if url_len == 2 || (url_len > 2 && path_columns[1].starts_with("settings")) {
if method.eq("GET") {
if path_columns[1].starts_with("settings") {
if method.eq("POST") || method.eq("DELETE") {
method = "PUT".to_string();
}
} else if method.eq("GET") {
method = "LIST".to_string();
}
format!(
Expand Down
6 changes: 3 additions & 3 deletions web/src/components/settings/General.vue
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export default defineComponent({
}
}
settingsService
.createLogo(orgIdentifier, formData)
.createLogo(store.state.selectedOrganization?.identifier || orgIdentifier, formData)
.then(async (res) => {
if (res.status == 200) {
q.notify({
Expand Down Expand Up @@ -343,7 +343,7 @@ export default defineComponent({
}
}
settingsService
.deleteLogo(orgIdentifier)
.deleteLogo(store.state.selectedOrganization?.identifier || orgIdentifier)
.then(async (res: any) => {
if (res.status == 200) {
q.notify({
Expand Down Expand Up @@ -385,7 +385,7 @@ export default defineComponent({
}
settingsService
.updateCustomText(orgIdentifier, "custom_logo_text", customText.value)
.updateCustomText(store.state.selectedOrganization?.identifier || orgIdentifier, "custom_logo_text", customText.value)
.then(async (res: any) => {
if (res.status == 200) {
q.notify({
Expand Down

0 comments on commit 90cc1b2

Please sign in to comment.