NM-288: move the platform user check in the middleware

This commit is contained in:
abhishek9686
2026-04-01 06:41:59 +05:30
parent 688f1c33a4
commit 79efb347cf
+4 -1
View File
@@ -59,7 +59,7 @@ func NetworkPermissionsCheck(username string, r *http.Request) error {
return nil
}
if userRole.ID == schema.Auditor || userRole.ID == schema.PlatformUser {
if userRole.ID == schema.Auditor {
if r.Method == http.MethodGet {
return nil
} else {
@@ -80,6 +80,9 @@ func NetworkPermissionsCheck(username string, r *http.Request) error {
if netID == "" {
return errors.New("network id is missing")
}
if userRole.ID == schema.PlatformUser && r.Method == http.MethodGet {
return nil
}
if r.Method == "" {
r.Method = http.MethodGet
}