Files
filestash/server/model/permissions.go
2021-08-22 16:47:09 +10:00

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
}