Documentation ¶
Index ¶
- func IdentityRoleFilterByID(identityRoleID uuid.UUID) func(db *gorm.DB) *gorm.DB
- type GormIdentityRoleRepository
- func (m *GormIdentityRoleRepository) CheckExists(ctx context.Context, id string) error
- func (m *GormIdentityRoleRepository) Create(ctx context.Context, u *IdentityRole) error
- func (m *GormIdentityRoleRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (m *GormIdentityRoleRepository) List(ctx context.Context) ([]IdentityRole, error)
- func (m *GormIdentityRoleRepository) Load(ctx context.Context, id uuid.UUID) (*IdentityRole, error)
- func (m *GormIdentityRoleRepository) Save(ctx context.Context, model *IdentityRole) error
- func (m *GormIdentityRoleRepository) TableName() string
- type GormRoleRepository
- func (m *GormRoleRepository) AddScope(ctx context.Context, u *Role, s *resource.ResourceTypeScope) error
- func (m *GormRoleRepository) CheckExists(ctx context.Context, id string) (bool, error)
- func (m *GormRoleRepository) Create(ctx context.Context, u *Role) error
- func (m *GormRoleRepository) Delete(ctx context.Context, id uuid.UUID) error
- func (m *GormRoleRepository) List(ctx context.Context) ([]Role, error)
- func (m *GormRoleRepository) ListScopes(ctx context.Context, u *Role) ([]resource.ResourceTypeScope, error)
- func (m *GormRoleRepository) Load(ctx context.Context, id uuid.UUID) (*Role, error)
- func (m *GormRoleRepository) Save(ctx context.Context, model *Role) error
- func (m *GormRoleRepository) TableName() string
- type IdentityRole
- type IdentityRoleRepository
- type Role
- type RoleRepository
- type RoleScope
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type GormIdentityRoleRepository ¶
type GormIdentityRoleRepository struct {
// contains filtered or unexported fields
}
GormIdentityRoleRepository is the implementation of the storage interface for IdentityRole.
func (*GormIdentityRoleRepository) CheckExists ¶
func (m *GormIdentityRoleRepository) CheckExists(ctx context.Context, id string) error
CheckExists returns nil if the given ID exists otherwise returns an error
func (*GormIdentityRoleRepository) Create ¶
func (m *GormIdentityRoleRepository) Create(ctx context.Context, u *IdentityRole) error
Create creates a new record.
func (*GormIdentityRoleRepository) Delete ¶
func (m *GormIdentityRoleRepository) Delete(ctx context.Context, id uuid.UUID) error
Delete removes a single record.
func (*GormIdentityRoleRepository) List ¶
func (m *GormIdentityRoleRepository) List(ctx context.Context) ([]IdentityRole, error)
List returns all identity roles
func (*GormIdentityRoleRepository) Load ¶
func (m *GormIdentityRoleRepository) Load(ctx context.Context, id uuid.UUID) (*IdentityRole, error)
Load returns a single IdentityRole as a Database Model This is more for use internally, and probably not what you want in your controllers
func (*GormIdentityRoleRepository) Save ¶
func (m *GormIdentityRoleRepository) Save(ctx context.Context, model *IdentityRole) error
Save modifies a single record
func (*GormIdentityRoleRepository) TableName ¶
func (m *GormIdentityRoleRepository) TableName() string
TableName overrides the table name settings in Gorm to force a specific table name in the database.
type GormRoleRepository ¶
type GormRoleRepository struct {
// contains filtered or unexported fields
}
GormRoleRepository is the implementation of the storage interface for Role.
func (*GormRoleRepository) AddScope ¶
func (m *GormRoleRepository) AddScope(ctx context.Context, u *Role, s *resource.ResourceTypeScope) error
func (*GormRoleRepository) CheckExists ¶
CheckExists returns nil if the given ID exists otherwise returns an error
func (*GormRoleRepository) Create ¶
func (m *GormRoleRepository) Create(ctx context.Context, u *Role) error
Create creates a new record.
func (*GormRoleRepository) List ¶
func (m *GormRoleRepository) List(ctx context.Context) ([]Role, error)
List returns all roles
func (*GormRoleRepository) ListScopes ¶
func (m *GormRoleRepository) ListScopes(ctx context.Context, u *Role) ([]resource.ResourceTypeScope, error)
func (*GormRoleRepository) Load ¶
Load returns a single Role as a Database Model This is more for use internally, and probably not what you want in your controllers
func (*GormRoleRepository) Save ¶
func (m *GormRoleRepository) Save(ctx context.Context, model *Role) error
Save modifies a single record
func (*GormRoleRepository) TableName ¶
func (m *GormRoleRepository) TableName() string
TableName overrides the table name settings in Gorm to force a specific table name in the database.
type IdentityRole ¶
type IdentityRole struct { gormsupport.Lifecycle // This is the primary key value IdentityRoleID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key" gorm:"column:identity_role_id"` // The identity to which the role is assigned Identity account.Identity // The resource to which the role is applied Resource resource.Resource // The role that is assigned Role Role }
func (IdentityRole) GetLastModified ¶
func (m IdentityRole) GetLastModified() time.Time
GetLastModified returns the last modification time
func (IdentityRole) TableName ¶
func (m IdentityRole) TableName() string
TableName overrides the table name settings in Gorm to force a specific table name in the database.
type IdentityRoleRepository ¶
type IdentityRoleRepository interface { repository.Exister Load(ctx context.Context, ID uuid.UUID) (*IdentityRole, error) Create(ctx context.Context, u *IdentityRole) error Save(ctx context.Context, u *IdentityRole) error List(ctx context.Context) ([]IdentityRole, error) Delete(ctx context.Context, ID uuid.UUID) error }
IdentityRoleRepository represents the storage interface.
func NewIdentityRoleRepository ¶
func NewIdentityRoleRepository(db *gorm.DB) IdentityRoleRepository
NewIdentityRoleRepository creates a new storage type.
type Role ¶
type Role struct { gormsupport.Lifecycle // This is the primary key value RoleID uuid.UUID `sql:"type:uuid default uuid_generate_v4()" gorm:"primary_key" gorm:"column:role_id"` // The resource type that this role applies to ResourceType resource.ResourceType `gorm:"ForeignKey:ResourceTypeID;AssociationForeignKey:ResourceTypeID"` // The foreign key value for ResourceType ResourceTypeID uuid.UUID // The name of this role Name string }
func (Role) GetLastModified ¶
GetLastModified returns the last modification time
type RoleRepository ¶
type RoleRepository interface { CheckExists(ctx context.Context, id string) (bool, error) Load(ctx context.Context, ID uuid.UUID) (*Role, error) Create(ctx context.Context, u *Role) error Save(ctx context.Context, u *Role) error List(ctx context.Context) ([]Role, error) Delete(ctx context.Context, ID uuid.UUID) error ListScopes(ctx context.Context, u *Role) ([]resource.ResourceTypeScope, error) AddScope(ctx context.Context, u *Role, s *resource.ResourceTypeScope) error }
RoleRepository represents the storage interface.
func NewRoleRepository ¶
func NewRoleRepository(db *gorm.DB) RoleRepository
NewRoleRepository creates a new storage type.
type RoleScope ¶
type RoleScope struct { gormsupport.Lifecycle RoleID uuid.UUID `sql:"type:uuid" gorm:"primary_key" gorm:"column:role_ID"` Scope resource.ResourceTypeScope `gorm:"ForeignKey:ScopeID;AssociationForeignKey:ResourceTypeScopeID"` ScopeID uuid.UUID `sql:"type:uuid" gorm:"primary_key" gorm:"column:role_ID"` }
func (RoleScope) GetLastModified ¶
GetLastModified returns the last modification time