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:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user