mirror of
https://github.com/get-drexa/drive.git
synced 2026-02-02 19:31:17 +00:00
feat: initial sharing impl
This commit is contained in:
21
apps/backend/internal/account/scoped_router.go
Normal file
21
apps/backend/internal/account/scoped_router.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package account
|
||||
|
||||
import "github.com/get-drexa/drexa/internal/virtualfs"
|
||||
|
||||
// ScopedRouter is a router with auth + account middleware applied.
|
||||
// Routes registered on this router have access to:
|
||||
// - The authenticated user via reqctx.AuthenticatedUser()
|
||||
// - The current account via reqctx.CurrentAccount()
|
||||
// - The VFS scope via reqctx.VFSAccessScope()
|
||||
//
|
||||
// This embeds virtualfs.ScopedRouter, so it can be passed to functions
|
||||
// that only require VFS scope by calling VFSRouter().
|
||||
type ScopedRouter struct {
|
||||
virtualfs.ScopedRouter
|
||||
}
|
||||
|
||||
// VFSRouter returns the embedded virtualfs.ScopedRouter for use with
|
||||
// functions that only require VFS scope access.
|
||||
func (r *ScopedRouter) VFSRouter() *virtualfs.ScopedRouter {
|
||||
return &r.ScopedRouter
|
||||
}
|
||||
Reference in New Issue
Block a user