2022-02-08 06:38:43 -06:00
|
|
|
|
package definitions
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"github.com/grafana/grafana/pkg/api/dtos"
|
|
|
|
|
"github.com/grafana/grafana/pkg/models"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
// swagger:route GET /dashboards/id/{DashboardID}/permissions dashboard_permissions getDashboardPermissions
|
|
|
|
|
//
|
|
|
|
|
// Gets all existing permissions for the given dashboard.
|
|
|
|
|
//
|
2022-04-21 09:24:03 -05:00
|
|
|
|
// Please refer to [updated API](#/dashboard_permissions/getDashboardPermissionsWithUid) instead
|
|
|
|
|
//
|
|
|
|
|
// Deprecated: true
|
|
|
|
|
//
|
2022-02-08 06:38:43 -06:00
|
|
|
|
// Responses:
|
|
|
|
|
// 200: getDashboardPermissionsResponse
|
|
|
|
|
// 401: unauthorisedError
|
|
|
|
|
// 403: forbiddenError
|
|
|
|
|
// 404: notFoundError
|
|
|
|
|
// 500: internalServerError
|
|
|
|
|
|
|
|
|
|
// swagger:route POST /dashboards/id/{DashboardID}/permissions dashboard_permissions postDashboardPermissions
|
|
|
|
|
//
|
|
|
|
|
// Updates permissions for a dashboard.
|
|
|
|
|
//
|
2022-04-21 09:24:03 -05:00
|
|
|
|
// Please refer to [updated API](#/dashboard_permissions/postDashboardPermissionsWithUid) instead
|
|
|
|
|
//
|
|
|
|
|
// This operation will remove existing permissions if they’re not included in the request.
|
|
|
|
|
//
|
|
|
|
|
// Deprecated: true
|
|
|
|
|
//
|
|
|
|
|
// Responses:
|
|
|
|
|
// 200: okResponse
|
|
|
|
|
// 400: badRequestError
|
|
|
|
|
// 401: unauthorisedError
|
|
|
|
|
// 403: forbiddenError
|
|
|
|
|
// 404: notFoundError
|
|
|
|
|
// 500: internalServerError
|
|
|
|
|
|
|
|
|
|
// swagger:route GET /dashboards/uid/{uid}/permissions dashboard_permissions getDashboardPermissionsWithUid
|
|
|
|
|
//
|
|
|
|
|
// Gets all existing permissions for the given dashboard.
|
|
|
|
|
//
|
|
|
|
|
// Responses:
|
|
|
|
|
// 200: getDashboardPermissionsResponse
|
|
|
|
|
// 401: unauthorisedError
|
|
|
|
|
// 403: forbiddenError
|
|
|
|
|
// 404: notFoundError
|
|
|
|
|
// 500: internalServerError
|
|
|
|
|
|
|
|
|
|
// swagger:route POST /dashboards/uid/{uid}/permissions dashboard_permissions postDashboardPermissionsWithUid
|
|
|
|
|
//
|
|
|
|
|
// Updates permissions for a dashboard.
|
|
|
|
|
//
|
2022-02-08 06:38:43 -06:00
|
|
|
|
// This operation will remove existing permissions if they’re not included in the request.
|
|
|
|
|
//
|
|
|
|
|
// Responses:
|
|
|
|
|
// 200: okResponse
|
|
|
|
|
// 400: badRequestError
|
|
|
|
|
// 401: unauthorisedError
|
|
|
|
|
// 403: forbiddenError
|
|
|
|
|
// 404: notFoundError
|
|
|
|
|
// 500: internalServerError
|
|
|
|
|
|
2022-06-14 05:35:22 -05:00
|
|
|
|
// swagger:parameters getDashboardPermissions
|
|
|
|
|
type GetDashboardPermissionsParams struct {
|
|
|
|
|
// in:path
|
|
|
|
|
DashboardID int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// swagger:parameters postDashboardPermissions
|
|
|
|
|
type PostDashboardPermissionsParams struct {
|
|
|
|
|
// in:body
|
|
|
|
|
// required:true
|
|
|
|
|
Body dtos.UpdateDashboardAclCommand
|
|
|
|
|
// in:path
|
|
|
|
|
DashboardID int64
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// swagger:parameters postDashboardPermissionsWithUid
|
|
|
|
|
type PostDashboardPermissionsWithUIDParams struct {
|
2022-02-08 06:38:43 -06:00
|
|
|
|
// in:body
|
|
|
|
|
// required:true
|
|
|
|
|
Body dtos.UpdateDashboardAclCommand
|
2022-06-14 05:35:22 -05:00
|
|
|
|
// in:path
|
|
|
|
|
// required:true
|
|
|
|
|
// description: The dashboard UID
|
|
|
|
|
UID string `json:"uid"`
|
2022-02-08 06:38:43 -06:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// swagger:response getDashboardPermissionsResponse
|
|
|
|
|
type GetDashboardPermissionsResponse struct {
|
|
|
|
|
// in: body
|
|
|
|
|
Body []*models.DashboardAclInfoDTO `json:"body"`
|
|
|
|
|
}
|