mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
accesscontrol
swagger: Add global
field to RoleDTO
type (#79351)
* `accesscontrol` swagger: Add `global` field to `RoleDTO` type The field is currently added in the MarshalJSON function so it isn't reflected in the spec This PR sets the "static" version of the RoleDTO, that has the global field, as the swagger model * Revert the marshalling logic
This commit is contained in:
parent
57e0d6bcb5
commit
b232c64d9a
@ -62,6 +62,7 @@ func (r Role) MarshalJSON() ([]byte, error) {
|
||||
})
|
||||
}
|
||||
|
||||
// swagger:ignore
|
||||
type RoleDTO struct {
|
||||
Version int64 `json:"version"`
|
||||
UID string `xorm:"uid" json:"uid"`
|
||||
@ -135,6 +136,12 @@ func (r *RoleDTO) IsExternalService() bool {
|
||||
return strings.HasPrefix(r.Name, ExternalServiceRolePrefix) || strings.HasPrefix(r.UID, ExternalServiceRoleUIDPrefix)
|
||||
}
|
||||
|
||||
// swagger:model RoleDTO
|
||||
type RoleDTOStatic struct {
|
||||
RoleDTO
|
||||
Global bool `json:"global" xorm:"-"`
|
||||
}
|
||||
|
||||
func (r RoleDTO) MarshalJSON() ([]byte, error) {
|
||||
type Alias RoleDTO
|
||||
|
||||
|
@ -4214,7 +4214,11 @@
|
||||
"type": "boolean"
|
||||
},
|
||||
"id": {
|
||||
"description": "Deprecated: use Uid instead",
|
||||
"description": "Deprecated: use UID instead",
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
"orgId": {
|
||||
"type": "integer",
|
||||
"format": "int64"
|
||||
},
|
||||
@ -6333,6 +6337,9 @@
|
||||
"displayName": {
|
||||
"type": "string"
|
||||
},
|
||||
"global": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"group": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -18142,6 +18142,9 @@
|
||||
"displayName": {
|
||||
"type": "string"
|
||||
},
|
||||
"global": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"group": {
|
||||
"type": "string"
|
||||
},
|
||||
|
@ -9073,6 +9073,9 @@
|
||||
"displayName": {
|
||||
"type": "string"
|
||||
},
|
||||
"global": {
|
||||
"type": "boolean"
|
||||
},
|
||||
"group": {
|
||||
"type": "string"
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user