mirror of
https://github.com/grafana/grafana.git
synced 2025-08-06 20:59:35 +08:00

* Copy dashboard models to dashboard pkg * Use some models from current pkg instead of models * Adjust api pkg * Adjust pkg services * Fix lint * Chore: Remove dashboards models * Remove dashboards from models pkg * Fix lint in tests * Fix lint in tests 2 * Fix for import in auth * Remove newline * Revert unused fix
61 lines
912 B
Go
61 lines
912 B
Go
package models
|
|
|
|
import (
|
|
"time"
|
|
|
|
"github.com/grafana/grafana/pkg/services/user"
|
|
)
|
|
|
|
type Folder struct {
|
|
Id int64
|
|
Uid string
|
|
Title string
|
|
Url string
|
|
Version int
|
|
|
|
Created time.Time
|
|
Updated time.Time
|
|
|
|
UpdatedBy int64
|
|
CreatedBy int64
|
|
HasACL bool
|
|
}
|
|
|
|
// NewFolder creates a new Folder
|
|
func NewFolder(title string) *Folder {
|
|
folder := &Folder{}
|
|
folder.Title = title
|
|
folder.Created = time.Now()
|
|
folder.Updated = time.Now()
|
|
return folder
|
|
}
|
|
|
|
//
|
|
// COMMANDS
|
|
//
|
|
|
|
type CreateFolderCommand struct {
|
|
Uid string `json:"uid"`
|
|
Title string `json:"title"`
|
|
|
|
Result *Folder `json:"-"`
|
|
}
|
|
|
|
type MoveFolderCommand struct {
|
|
ParentUID *string `json:"parentUid"`
|
|
}
|
|
|
|
//
|
|
// QUERIES
|
|
//
|
|
|
|
type HasEditPermissionInFoldersQuery struct {
|
|
SignedInUser *user.SignedInUser
|
|
Result bool
|
|
}
|
|
|
|
type HasAdminPermissionInDashboardsOrFoldersQuery struct {
|
|
SignedInUser *user.SignedInUser
|
|
Result bool
|
|
}
|