incredible-go-core/pkg/io/files/auto_file_perm.go

18 lines
246 B
Go
Raw Permalink Normal View History

package files
import (
"os"
)
func GetPermForDir(dirLocation string) os.FileMode {
userHome, err := os.UserHomeDir()
if err == nil {
if IsFileLocatedIn(dirLocation, userHome) {
return DirUserPermitted
}
}
return DirAllPermitted
}