Guardian: Introduce additional constructors (#59577)
* Guardian: Use dashboard UID instead of ID * Apply suggestions from code review Introduce several guardian constructors and each time use the most appropriate one.
This commit is contained in:
@@ -54,15 +54,6 @@ func (d *Dashboard) SetVersion(version int) {
|
||||
d.Data.Set("version", version)
|
||||
}
|
||||
|
||||
// GetDashboardIdForSavePermissionCheck return the dashboard id to be used for checking permission of dashboard
|
||||
func (d *Dashboard) GetDashboardIdForSavePermissionCheck() int64 {
|
||||
if d.Id == 0 {
|
||||
return d.FolderId
|
||||
}
|
||||
|
||||
return d.Id
|
||||
}
|
||||
|
||||
// NewDashboard creates a new dashboard
|
||||
func NewDashboard(title string) *Dashboard {
|
||||
dash := &Dashboard{}
|
||||
|
||||
Reference in New Issue
Block a user