mirror of
https://github.com/usememos/memos.git
synced 2025-10-10 22:36:21 +08:00
chore: disallow update workspace setting in demo mode
This commit is contained in:
parent
cf207df672
commit
1e43c8d84b
1 changed files with 4 additions and 0 deletions
|
@ -34,6 +34,10 @@ func (s *APIV2Service) GetWorkspaceSetting(ctx context.Context, request *apiv2pb
|
|||
}
|
||||
|
||||
func (s *APIV2Service) SetWorkspaceSetting(ctx context.Context, request *apiv2pb.SetWorkspaceSettingRequest) (*apiv2pb.SetWorkspaceSettingResponse, error) {
|
||||
if s.Profile.Mode == "demo" {
|
||||
return nil, status.Errorf(codes.InvalidArgument, "setting workspace setting is not allowed in demo mode")
|
||||
}
|
||||
|
||||
user, err := getCurrentUser(ctx, s.Store)
|
||||
if err != nil {
|
||||
return nil, status.Errorf(codes.Internal, "failed to get current user: %v", err)
|
||||
|
|
Loading…
Add table
Reference in a new issue