mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-12-22 09:30:14 +01:00
🎨 Add file access control (#9722)
This commit is contained in:
parent
f5205d846c
commit
4ca62ef701
5 changed files with 139 additions and 65 deletions
|
|
@ -265,3 +265,12 @@ func IsDisplayableAsset(p string) bool {
|
|||
}
|
||||
return false
|
||||
}
|
||||
|
||||
func GetAbsPathInWorkspace(relPath string) (string, error) {
|
||||
absPath := filepath.Join(WorkspaceDir, relPath)
|
||||
if IsSubPath(WorkspaceDir, absPath) {
|
||||
return absPath, nil
|
||||
} else {
|
||||
return "", os.ErrPermission
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue