Documentation ¶
Index ¶
- func Migration(rolesTableNamePrefix, entityTableName, entityIDColumnName string) (*migrate.MemoryMigrationSource, error)
- type Repository
- func (repo *Repository) AddRoles(ctx context.Context, rps []roles.RoleProvision) ([]roles.Role, error)
- func (repo *Repository) RemoveMemberFromAllRoles(ctx context.Context, memberID string) (err error)
- func (repo *Repository) RemoveRoles(ctx context.Context, roleIDs []string) error
- func (repo *Repository) RetrieveAllRoles(ctx context.Context, entityID string, limit, offset uint64) (roles.RolePage, error)
- func (repo *Repository) RetrieveEntitiesRolesActionsMembers(ctx context.Context, entityIDs []string) ([]roles.EntityActionRole, []roles.EntityMemberRole, error)
- func (repo *Repository) RetrieveRole(ctx context.Context, roleID string) (roles.Role, error)
- func (repo *Repository) RetrieveRoleByEntityIDAndName(ctx context.Context, entityID, roleName string) (roles.Role, error)
- func (repo *Repository) RoleAddActions(ctx context.Context, role roles.Role, actions []string) (caps []string, err error)
- func (repo *Repository) RoleAddMembers(ctx context.Context, role roles.Role, members []string) ([]string, error)
- func (repo *Repository) RoleCheckActionsExists(ctx context.Context, roleID string, actions []string) (bool, error)
- func (repo *Repository) RoleCheckMembersExists(ctx context.Context, roleID string, members []string) (bool, error)
- func (repo *Repository) RoleListActions(ctx context.Context, roleID string) ([]string, error)
- func (repo *Repository) RoleListMembers(ctx context.Context, roleID string, limit, offset uint64) (roles.MembersPage, error)
- func (repo *Repository) RoleRemoveActions(ctx context.Context, role roles.Role, actions []string) (err error)
- func (repo *Repository) RoleRemoveAllActions(ctx context.Context, role roles.Role) error
- func (repo *Repository) RoleRemoveAllMembers(ctx context.Context, role roles.Role) (err error)
- func (repo *Repository) RoleRemoveMembers(ctx context.Context, role roles.Role, members []string) (err error)
- func (repo *Repository) UpdateRole(ctx context.Context, role roles.Role) (roles.Role, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
func NewRepository ¶
func NewRepository(db postgres.Database, tableNamePrefix, entityTableName, entityIDColumnName string) Repository
NewRepository instantiates a PostgreSQL implementation of Roles repository.
func (*Repository) AddRoles ¶
func (repo *Repository) AddRoles(ctx context.Context, rps []roles.RoleProvision) ([]roles.Role, error)
func (*Repository) RemoveMemberFromAllRoles ¶
func (repo *Repository) RemoveMemberFromAllRoles(ctx context.Context, memberID string) (err error)
func (*Repository) RemoveRoles ¶
func (repo *Repository) RemoveRoles(ctx context.Context, roleIDs []string) error
func (*Repository) RetrieveAllRoles ¶
func (*Repository) RetrieveEntitiesRolesActionsMembers ¶
func (repo *Repository) RetrieveEntitiesRolesActionsMembers(ctx context.Context, entityIDs []string) ([]roles.EntityActionRole, []roles.EntityMemberRole, error)
func (*Repository) RetrieveRole ¶
func (*Repository) RetrieveRoleByEntityIDAndName ¶
func (*Repository) RoleAddActions ¶
func (*Repository) RoleAddMembers ¶
func (*Repository) RoleCheckActionsExists ¶
func (*Repository) RoleCheckMembersExists ¶
func (*Repository) RoleListActions ¶
func (*Repository) RoleListMembers ¶
func (repo *Repository) RoleListMembers(ctx context.Context, roleID string, limit, offset uint64) (roles.MembersPage, error)
func (*Repository) RoleRemoveActions ¶
func (*Repository) RoleRemoveAllActions ¶
func (*Repository) RoleRemoveAllMembers ¶
func (*Repository) RoleRemoveMembers ¶
func (*Repository) UpdateRole ¶
Update only role name, don't update ID
Click to show internal directories.
Click to hide internal directories.