fix: complete mobile and session interactions
This commit is contained in:
@@ -569,15 +569,19 @@ type accessibleRoot struct {
|
||||
|
||||
func (s *Server) roots(w http.ResponseWriter, r *http.Request) {
|
||||
a := account(r, s)
|
||||
if a == nil || a.Username == "" {
|
||||
if a == nil {
|
||||
writeJSONError(w, http.StatusUnauthorized, "not authenticated")
|
||||
return
|
||||
}
|
||||
seen := map[string]bool{}
|
||||
out := make([]accessibleRoot, 0)
|
||||
if a.Admin && a.MaskFor("").HasRead() {
|
||||
if a.MaskFor("").HasRead() {
|
||||
seen[""] = true
|
||||
out = append(out, accessibleRoot{Path: "", Name: "全部文件", Mask: permString(a.MaskFor("")), Home: false})
|
||||
name := "共享文件"
|
||||
if a.Admin {
|
||||
name = "全部文件"
|
||||
}
|
||||
out = append(out, accessibleRoot{Path: "", Name: name, Mask: permString(a.MaskFor("")), Home: false})
|
||||
}
|
||||
if a.Home != "" && a.MaskFor(a.Home).HasRead() {
|
||||
home := strings.Trim(a.Home, "/")
|
||||
|
||||
Reference in New Issue
Block a user