Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type OrganizationService ¶
type OrganizationService interface {
Create(ctx context.Context, name, description string) (*model.Organization, error)
FindById(ctx context.Context, strId string) (*model.Organization, error)
FindByName(ctx context.Context, name string) (*model.Organization, error)
FindAll(ctx context.Context) (model.Organizations, error)
Update(ctx context.Context, strId, name, description string) error
Delete(ctx context.Context, strId string) error
}
func NewOrganizationService ¶ added in v0.0.4
func NewOrganizationService(reader repository.Reader, writer repository.Writer) OrganizationService
type PermissionService ¶
type PermissionService interface {
Create(ctx context.Context, names, descriptions []string) (model.Permissions, error)
FindById(ctx context.Context, strId string) (*model.Permission, error)
FindAll(ctx context.Context) (model.Permissions, error)
Update(ctx context.Context, strId, name, description string) error
Delete(ctx context.Context, strId string) error
Check(ctx context.Context, userKey, organizationName string, permissionNames ...string) (*model.ResourceCheck, error)
}
func NewPermissionService ¶ added in v0.0.4
func NewPermissionService(reader repository.Reader, writer repository.Writer) PermissionService
type Resource ¶
type Resource interface {
Save(ctx context.Context, method, uri string, permissions ...string) error
Authorized(ctx context.Context, method, uri, organizationName, userKey string) bool
}
func NewResource ¶ added in v0.0.4
func NewResource(reader repository.Reader, writer repository.Writer) Resource
type RoleService ¶
type RoleService interface {
Create(ctx context.Context, names, descriptions []string) (model.Roles, error)
FindById(ctx context.Context, strId string) (*model.Role, error)
FindAll(ctx context.Context) (model.Roles, error)
Update(ctx context.Context, strId string, name, description string) error
Delete(ctx context.Context, strId string) error
GetPermissions(ctx context.Context, strId string) (model.Permissions, error)
AddPermissions(ctx context.Context, strId string, permissionIds []string) error
DeletePermissions(ctx context.Context, strId string, permissionIds []string) error
}
func NewRoleService ¶ added in v0.0.4
func NewRoleService(reader repository.Reader, writer repository.Writer) RoleService
type UserService ¶
type UserService interface {
Create(ctx context.Context, userKey, organizationId string, roleIds ...string) error
Delete(ctx context.Context, userKey, organizationId string) error
FindByKey(ctx context.Context, userKey, organizationId string) (*model.User, error)
AddRole(ctx context.Context, userKey, organizationId string, roleIds []string) error
DeleteRole(ctx context.Context, userKey, organizationId string, roleIds []string) error
}
func NewUserService ¶ added in v0.0.4
func NewUserService(reader repository.Reader, writer repository.Writer) UserService
Click to show internal directories.
Click to hide internal directories.