Commit ea74fd55 authored by MaksimSmile13's avatar MaksimSmile13
Browse files

Merge branch 'noc-fix-grafanads-annotations' into 'master'

Fix Grafanads Annotations

See merge request !6418
parents b7da751b 7a875a47
...@@ -65,7 +65,7 @@ class ManagedObjectJsonDS(JsonDSAPI): ...@@ -65,7 +65,7 @@ class ManagedObjectJsonDS(JsonDSAPI):
mo: "ManagedObject" = ManagedObject.get_by_id(int(annotation.query)) mo: "ManagedObject" = ManagedObject.get_by_id(int(annotation.query))
if not mo: if not mo:
raise HTTPException(status_code=404, detail="Managed Object Does Not Exists") raise HTTPException(status_code=404, detail="Managed Object Does Not Exists")
if not user.is_superuser and mo.administrative_domain not in set( if not user.is_superuser and mo.administrative_domain.id not in set(
UserAccess.get_domains(user) UserAccess.get_domains(user)
): ):
raise HTTPException(status_code=404, detail="ManagedObject not Permission") raise HTTPException(status_code=404, detail="ManagedObject not Permission")
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment