18 lines
246 B
Go
18 lines
246 B
Go
|
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
|
||
|
}
|