Merge branch 'apps'

This commit is contained in:
Torkel Ödegaard
2016-01-12 15:41:15 +01:00
160 changed files with 1755 additions and 1164 deletions
@@ -2,11 +2,12 @@ package models
import "time"
type PluginBundle struct {
type AppSettings struct {
Id int64
Type string
AppId string
OrgId int64
Enabled bool
Pinned bool
JsonData map[string]interface{}
Created time.Time
@@ -17,18 +18,18 @@ type PluginBundle struct {
// COMMANDS
// Also acts as api DTO
type UpdatePluginBundleCmd struct {
Type string `json:"type" binding:"Required"`
type UpdateAppSettingsCmd struct {
Enabled bool `json:"enabled"`
Pinned bool `json:"pinned"`
JsonData map[string]interface{} `json:"jsonData"`
Id int64 `json:"-"`
OrgId int64 `json:"-"`
AppId string `json:"-"`
OrgId int64 `json:"-"`
}
// ---------------------
// QUERIES
type GetPluginBundlesQuery struct {
type GetAppSettingsQuery struct {
OrgId int64
Result []*PluginBundle
Result []*AppSettings
}
+11
View File
@@ -26,6 +26,17 @@ func (r RoleType) IsValid() bool {
return r == ROLE_VIEWER || r == ROLE_ADMIN || r == ROLE_EDITOR || r == ROLE_READ_ONLY_EDITOR
}
func (r RoleType) Includes(other RoleType) bool {
if r == ROLE_ADMIN {
return true
}
if r == ROLE_EDITOR || r == ROLE_READ_ONLY_EDITOR {
return other != ROLE_ADMIN
}
return r == other
}
type OrgUser struct {
Id int64
OrgId int64