diff options
author | Ryan Dahl <ry@tinyclouds.org> | 2018-05-29 05:27:41 -0400 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2018-05-29 05:27:41 -0400 |
commit | e64e4e3ec85753dcfcc1a0bfa3c65573e351b0ef (patch) | |
tree | 19098ac25875cedaf5271723bc19806cd10f29e8 /os.go | |
parent | 47cfde452d5638fb7eb418a70ef775c03d25f91c (diff) |
Add permission flags
Diffstat (limited to 'os.go')
-rw-r--r-- | os.go | 9 |
1 files changed, 8 insertions, 1 deletions
@@ -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{} |