mirror of
https://github.com/mickael-kerjean/filestash.git
synced 2025-10-27 03:26:22 +08:00
34 lines
493 B
Go
34 lines
493 B
Go
package model
|
|
|
|
import (
|
|
. "github.com/mickael-kerjean/filestash/server/common"
|
|
)
|
|
|
|
func CanRead(ctx *App) bool {
|
|
if ctx.Share.Id != "" {
|
|
return ctx.Share.CanRead
|
|
}
|
|
return true
|
|
}
|
|
|
|
func CanEdit(ctx *App) bool {
|
|
if ctx.Share.Id != "" {
|
|
return ctx.Share.CanWrite
|
|
}
|
|
return true
|
|
}
|
|
|
|
func CanUpload(ctx *App) bool {
|
|
if ctx.Share.Id != "" {
|
|
return ctx.Share.CanUpload
|
|
}
|
|
return true
|
|
}
|
|
|
|
func CanShare(ctx *App) bool {
|
|
if ctx.Share.Id != "" {
|
|
return ctx.Share.CanShare
|
|
}
|
|
return true
|
|
}
|