mirror of
				https://github.com/gravitl/netmaker.git
				synced 2025-10-31 04:06:37 +08:00 
			
		
		
		
	NM-57: Graphs API Forbidden for Platform User (#3577)
* fix(go): permissions for network graph; * fix(go): allow platform user to get network graph; * feat(go): allow read only access to host resource to network users. * feat(go): remove specific check for hosts resource.
This commit is contained in:
		| @@ -60,6 +60,11 @@ func userMiddleWare(handler http.Handler) http.Handler { | ||||
| 		if strings.Contains(route, "networks") { | ||||
| 			r.Header.Set("TARGET_RSRC", models.NetworkRsrc.String()) | ||||
| 		} | ||||
| 		// check 'graph' after 'networks', otherwise the | ||||
| 		// header will be overwritten. | ||||
| 		if strings.Contains(route, "graph") { | ||||
| 			r.Header.Set("TARGET_RSRC", models.HostRsrc.String()) | ||||
| 		} | ||||
| 		if strings.Contains(route, "acls") { | ||||
| 			r.Header.Set("TARGET_RSRC", models.AclRsrc.String()) | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Vishal Dalwadi
					Vishal Dalwadi