summaryrefslogtreecommitdiff
path: root/os.go
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2018-05-29 05:27:41 -0400
committerRyan Dahl <ry@tinyclouds.org>2018-05-29 05:27:41 -0400
commite64e4e3ec85753dcfcc1a0bfa3c65573e351b0ef (patch)
tree19098ac25875cedaf5271723bc19806cd10f29e8 /os.go
parent47cfde452d5638fb7eb418a70ef775c03d25f91c (diff)
Add permission flags
Diffstat (limited to 'os.go')
-rw-r--r--os.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/os.go b/os.go
index 7eebe41bd..877fa24ca 100644
--- a/os.go
+++ b/os.go
@@ -17,7 +17,14 @@ const assetPrefix string = "/$asset$/"
var fs afero.Fs
func InitOS() {
- fs = afero.NewOsFs()
+ if Perms.FsWrite {
+ assert(Perms.FsRead, "Write access requires read access.")
+ fs = afero.NewOsFs()
+ } else if Perms.FsRead {
+ fs = afero.NewReadOnlyFs(afero.NewOsFs())
+ } else {
+ panic("Not implemented.")
+ }
Sub("os", func(buf []byte) []byte {
msg := &Msg{}