Disable some menu items in read-only mode (#11733)

* 🎨 kernel supports read-only publishing services

* 🐛 Fix authentication vulnerabilities

* 🎨 Protect secret information

* 🎨 Adjust the permission control

* 🎨 Adjust the permission control

* 🎨 Fixed the vulnerability that `getFile` gets file `conf.json`

* 🎨 Add API `/api/setting/setPublish`

* 🎨 Add API `/api/setting/getPublish`

* 🐛 Fixed the issue that PWA-related files could not pass BasicAuth

* 🎨 Add a settings panel for publishing features

* 📝 Add guide for `Publish Service`

* 📝 Update Japanese user guide

* 🎨 Merge fixed static file services

* 🎨 Disable some menu items in read-only mode

* 🎨 Disable some menu items in read-only mode

* Update router.go
This commit is contained in:
Yingyi / 颖逸 2024-07-05 20:01:43 +08:00 committed by GitHub
parent 1260b14875
commit f25b36ff38
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
18 changed files with 150 additions and 80 deletions

View file

@ -18,13 +18,14 @@ package api
import (
"encoding/hex"
"github.com/siyuan-note/logging"
"io"
"net/http"
"os"
"path/filepath"
"time"
"github.com/siyuan-note/logging"
"github.com/88250/gulu"
"github.com/gin-gonic/gin"
"github.com/siyuan-note/siyuan/kernel/conf"
@ -381,10 +382,6 @@ func getBootSync(c *gin.Context) {
ret := gulu.Ret.NewResult()
defer c.JSON(http.StatusOK, ret)
if !model.IsAdminRoleContext(c) {
return
}
if model.Conf.Sync.Enabled && 1 == model.BootSyncSucc {
ret.Code = 1
ret.Msg = model.Conf.Language(17)