mirror of
https://github.com/get-drexa/drive.git
synced 2026-02-02 12:01:17 +00:00
refactor: account model overhaul
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
const authenticatedUserKey = "authenticatedUser"
|
||||
const vfsAccessScope = "vfsAccessScope"
|
||||
const currentAccountKey = "currentAccount"
|
||||
const currentDriveKey = "currentDrive"
|
||||
|
||||
var ErrUnauthenticatedRequest = errors.New("unauthenticated request")
|
||||
|
||||
@@ -29,6 +30,11 @@ func SetCurrentAccount(c *fiber.Ctx, account any) {
|
||||
c.Locals(currentAccountKey, account)
|
||||
}
|
||||
|
||||
// SetCurrentDrive sets the current drive in the fiber context.
|
||||
func SetCurrentDrive(c *fiber.Ctx, drive any) {
|
||||
c.Locals(currentDriveKey, drive)
|
||||
}
|
||||
|
||||
// SetVFSAccessScope sets the VFS access scope in the fiber context.
|
||||
func SetVFSAccessScope(c *fiber.Ctx, scope any) {
|
||||
c.Locals(vfsAccessScope, scope)
|
||||
@@ -39,6 +45,11 @@ func CurrentAccount(c *fiber.Ctx) any {
|
||||
return c.Locals(currentAccountKey)
|
||||
}
|
||||
|
||||
// CurrentDrive returns the current drive from the given fiber context.
|
||||
func CurrentDrive(c *fiber.Ctx) any {
|
||||
return c.Locals(currentDriveKey)
|
||||
}
|
||||
|
||||
// VFSAccessScope returns the VFS access scope from the given fiber context.
|
||||
func VFSAccessScope(c *fiber.Ctx) any {
|
||||
return c.Locals(vfsAccessScope)
|
||||
|
||||
Reference in New Issue
Block a user