Documentation
¶
Index ¶
- type BunRolePermissionRepository
- func (r *BunRolePermissionRepository) AddRolePermission(ctx context.Context, roleID string, permissionID string, ...) error
- func (r *BunRolePermissionRepository) AssignUserRole(ctx context.Context, userID string, roleID string, assignedByUserID *string, ...) error
- func (r *BunRolePermissionRepository) CountRoleAssignmentsByPermissionID(ctx context.Context, permissionID string) (int, error)
- func (r *BunRolePermissionRepository) CountUserAssignmentsByRoleID(ctx context.Context, roleID string) (int, error)
- func (r *BunRolePermissionRepository) CreatePermission(ctx context.Context, permission *types.Permission) error
- func (r *BunRolePermissionRepository) CreateRole(ctx context.Context, role *types.Role) error
- func (r *BunRolePermissionRepository) DeletePermission(ctx context.Context, permissionID string) (bool, error)
- func (r *BunRolePermissionRepository) DeleteRole(ctx context.Context, roleID string) (bool, error)
- func (r *BunRolePermissionRepository) GetAllPermissions(ctx context.Context) ([]types.Permission, error)
- func (r *BunRolePermissionRepository) GetAllRoles(ctx context.Context) ([]types.Role, error)
- func (r *BunRolePermissionRepository) GetPermissionByID(ctx context.Context, permissionID string) (*types.Permission, error)
- func (r *BunRolePermissionRepository) GetRoleByID(ctx context.Context, roleID string) (*types.Role, error)
- func (r *BunRolePermissionRepository) GetRolePermissions(ctx context.Context, roleID string) ([]types.UserPermissionInfo, error)
- func (r *BunRolePermissionRepository) RemoveRolePermission(ctx context.Context, roleID string, permissionID string) error
- func (r *BunRolePermissionRepository) RemoveUserRole(ctx context.Context, userID string, roleID string) error
- func (r *BunRolePermissionRepository) ReplaceRolePermissions(ctx context.Context, roleID string, permissionIDs []string, ...) error
- func (r *BunRolePermissionRepository) ReplaceUserRoles(ctx context.Context, userID string, roleIDs []string, assignedByUserID *string) error
- func (r *BunRolePermissionRepository) UpdatePermission(ctx context.Context, permissionID string, description *string) (bool, error)
- func (r *BunRolePermissionRepository) UpdateRole(ctx context.Context, roleID string, name *string, description *string) (bool, error)
- type BunUserAccessRepository
- func (r *BunUserAccessRepository) GetUserEffectivePermissions(ctx context.Context, userID string) ([]types.UserPermissionInfo, error)
- func (r *BunUserAccessRepository) GetUserRoles(ctx context.Context, userID string) ([]types.UserRoleInfo, error)
- func (r *BunUserAccessRepository) GetUserWithPermissionsByID(ctx context.Context, userID string) (*types.UserWithPermissions, error)
- func (r *BunUserAccessRepository) GetUserWithRolesByID(ctx context.Context, userID string) (*types.UserWithRoles, error)
- type RolePermissionRepository
- type UserAccessRepository
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BunRolePermissionRepository ¶
type BunRolePermissionRepository struct {
// contains filtered or unexported fields
}
func NewBunRolePermissionRepository ¶
func NewBunRolePermissionRepository(db bun.IDB) *BunRolePermissionRepository
func (*BunRolePermissionRepository) AddRolePermission ¶
func (*BunRolePermissionRepository) AssignUserRole ¶
func (*BunRolePermissionRepository) CountRoleAssignmentsByPermissionID ¶
func (*BunRolePermissionRepository) CountUserAssignmentsByRoleID ¶
func (*BunRolePermissionRepository) CreatePermission ¶
func (r *BunRolePermissionRepository) CreatePermission(ctx context.Context, permission *types.Permission) error
func (*BunRolePermissionRepository) CreateRole ¶
func (*BunRolePermissionRepository) DeletePermission ¶
func (*BunRolePermissionRepository) DeleteRole ¶
func (*BunRolePermissionRepository) GetAllPermissions ¶
func (r *BunRolePermissionRepository) GetAllPermissions(ctx context.Context) ([]types.Permission, error)
func (*BunRolePermissionRepository) GetAllRoles ¶
func (*BunRolePermissionRepository) GetPermissionByID ¶
func (r *BunRolePermissionRepository) GetPermissionByID(ctx context.Context, permissionID string) (*types.Permission, error)
func (*BunRolePermissionRepository) GetRoleByID ¶
func (*BunRolePermissionRepository) GetRolePermissions ¶
func (r *BunRolePermissionRepository) GetRolePermissions(ctx context.Context, roleID string) ([]types.UserPermissionInfo, error)
func (*BunRolePermissionRepository) RemoveRolePermission ¶
func (*BunRolePermissionRepository) RemoveUserRole ¶
func (*BunRolePermissionRepository) ReplaceRolePermissions ¶
func (*BunRolePermissionRepository) ReplaceUserRoles ¶
func (*BunRolePermissionRepository) UpdatePermission ¶
func (*BunRolePermissionRepository) UpdateRole ¶
type BunUserAccessRepository ¶
type BunUserAccessRepository struct {
// contains filtered or unexported fields
}
func NewBunUserAccessRepository ¶
func NewBunUserAccessRepository(db bun.IDB) *BunUserAccessRepository
func (*BunUserAccessRepository) GetUserEffectivePermissions ¶
func (r *BunUserAccessRepository) GetUserEffectivePermissions(ctx context.Context, userID string) ([]types.UserPermissionInfo, error)
func (*BunUserAccessRepository) GetUserRoles ¶
func (r *BunUserAccessRepository) GetUserRoles(ctx context.Context, userID string) ([]types.UserRoleInfo, error)
func (*BunUserAccessRepository) GetUserWithPermissionsByID ¶
func (r *BunUserAccessRepository) GetUserWithPermissionsByID(ctx context.Context, userID string) (*types.UserWithPermissions, error)
func (*BunUserAccessRepository) GetUserWithRolesByID ¶
func (r *BunUserAccessRepository) GetUserWithRolesByID(ctx context.Context, userID string) (*types.UserWithRoles, error)
type RolePermissionRepository ¶
type RolePermissionRepository interface {
CreateRole(ctx context.Context, role *types.Role) error
GetAllRoles(ctx context.Context) ([]types.Role, error)
GetRoleByID(ctx context.Context, roleID string) (*types.Role, error)
UpdateRole(ctx context.Context, roleID string, name *string, description *string) (bool, error)
DeleteRole(ctx context.Context, roleID string) (bool, error)
GetAllPermissions(ctx context.Context) ([]types.Permission, error)
GetPermissionByID(ctx context.Context, permissionID string) (*types.Permission, error)
CreatePermission(ctx context.Context, permission *types.Permission) error
UpdatePermission(ctx context.Context, permissionID string, description *string) (bool, error)
DeletePermission(ctx context.Context, permissionID string) (bool, error)
GetRolePermissions(ctx context.Context, roleID string) ([]types.UserPermissionInfo, error)
ReplaceRolePermissions(ctx context.Context, roleID string, permissionIDs []string, grantedByUserID *string) error
AddRolePermission(ctx context.Context, roleID string, permissionID string, grantedByUserID *string) error
RemoveRolePermission(ctx context.Context, roleID string, permissionID string) error
ReplaceUserRoles(ctx context.Context, userID string, roleIDs []string, assignedByUserID *string) error
AssignUserRole(ctx context.Context, userID string, roleID string, assignedByUserID *string, expiresAt *time.Time) error
RemoveUserRole(ctx context.Context, userID string, roleID string) error
CountUserAssignmentsByRoleID(ctx context.Context, roleID string) (int, error)
CountRoleAssignmentsByPermissionID(ctx context.Context, permissionID string) (int, error)
}
type UserAccessRepository ¶
type UserAccessRepository interface {
GetUserRoles(ctx context.Context, userID string) ([]types.UserRoleInfo, error)
GetUserEffectivePermissions(ctx context.Context, userID string) ([]types.UserPermissionInfo, error)
GetUserWithRolesByID(ctx context.Context, userID string) (*types.UserWithRoles, error)
GetUserWithPermissionsByID(ctx context.Context, userID string) (*types.UserWithPermissions, error)
}
Click to show internal directories.
Click to hide internal directories.