Access control: FGAC for annotation updates (#46462)

* proposal

* PR feedback

* fix canSave bug

* update scope naming

* linting

* linting

Co-authored-by: Ezequiel Victorero <ezequiel.victorero@grafana.com>
This commit is contained in:
Ieva
2022-03-18 17:33:21 +01:00
committed by GitHub
co-authored by Ezequiel Victorero
parent 6eecd021a4
commit f2450575b3
8 changed files with 280 additions and 48 deletions
+14
View File
@@ -145,3 +145,17 @@ type ItemDTO struct {
AvatarUrl string `json:"avatarUrl"`
Data *simplejson.Json `json:"data"`
}
type annotationType int
const (
Global annotationType = iota
Local
)
func (annotation *ItemDTO) GetType() annotationType {
if annotation.DashboardId != 0 {
return Local
}
return Global
}