domain

package
v0.0.0-...-2f4d8a3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const SystemAdminID = 1
View Source
const SystemOwnerID = 2

Variables

View Source
var AdministratorRole = &role{Name: "Administrator"}
View Source
var GuestRole = &role{Name: "Guest"}
View Source
var ManagerRole = &role{Name: "Manager"}
View Source
var OwnerRole = &role{Name: "Owner"}
View Source
var UnknownRole = &role{Name: "Unknown"}
View Source
var UserRole = &role{Name: "User"}

Functions

This section is empty.

Types

type AppUserGroupID

type AppUserGroupID uint

type AppUserGroupModel

type AppUserGroupModel interface {
	Model
	GetAppUerGroupID() AppUserGroupID
	GetOrganizationID() OrganizationID
	GetKey() string
	GetName() string
	GetDescription() string
}

func NewAppUserGroup

func NewAppUserGroup(model Model, organizationID OrganizationID, key, name, description string) (AppUserGroupModel, error)

NewAppUserGroup returns a new AppUserGroup

type AppUserID

type AppUserID uint

type AppUserModel

type AppUserModel interface {
	Model
	GetAppUserID() AppUserID
	GetOrganizationID() OrganizationID
	GetLoginID() string
	GetUsername() string
	GetRoles() []string
	GetProperties() map[string]string
}

func NewAppUserModel

func NewAppUserModel(model Model, organizationID OrganizationID, loginID, username string, roles []string, properties map[string]string) (AppUserModel, error)

type Model

type Model interface {
	GetID() uint
	GetVersion() int
	GetCreatedAt() time.Time
	GetUpdatedAt() time.Time
	GetCreatedBy() uint
	GetUpdatedBy() uint
}

func NewModel

func NewModel(id uint, version int, createdAt, updatedAt time.Time, createdBy, updatedBy uint) (Model, error)

type OrganizationID

type OrganizationID uint

type OrganizationModel

type OrganizationModel interface {
	Model
	GetName() string
}

func NewOrganizationModel

func NewOrganizationModel(model Model, name string) (OrganizationModel, error)

type OwnerModel

type OwnerModel interface {
	AppUserModel
	IsOwnerModel() bool
}

func NewOwnerModel

func NewOwnerModel(appUser AppUserModel) (OwnerModel, error)

type Privileges

type Privileges interface {
	HasPrivilege(privilege RBACAction) bool
}

func NewPrivileges

func NewPrivileges(privs []RBACAction) Privileges

type RBACAction

type RBACAction string

type RBACObject

type RBACObject string

func NewSpaceObject

func NewSpaceObject(spaceID SpaceID) RBACObject

type RBACRole

type RBACRole string

func NewSpaceWriterRole

func NewSpaceWriterRole(spaceID SpaceID) RBACRole

type RBACUser

type RBACUser string

func NewUserObject

func NewUserObject(appUserID AppUserID) RBACUser

type Role

type Role interface {
	GetName() string
}

type SpaceID

type SpaceID uint

type SpaceModel

type SpaceModel interface {
	Model
	GetOrganizationID() OrganizationID
	GetKey() string
	GetName() string
	GetDescription() string
}

func NewSpaceModel

func NewSpaceModel(model Model, organizationID OrganizationID, spaceType int, key, name, description string) (SpaceModel, error)

type SpaceTypeID

type SpaceTypeID int

type SystemAdminModel

type SystemAdminModel interface {
	GetID() uint
	IsSystemAdminModel() bool
}

func NewSystemAdminModel

func NewSystemAdminModel() SystemAdminModel

type SystemOwnerModel

type SystemOwnerModel interface {
	OwnerModel
	IsSystemOwnerModel() bool
}

func NewSystemOwnerModel

func NewSystemOwnerModel(appUser OwnerModel) (SystemOwnerModel, error)

type UserPreference

type UserPreference interface {
	GetPreferences() map[string]interface{}
}

func NewUserPreference

func NewUserPreference(preferences map[string]interface{}) UserPreference

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL