diff --git a/proto/api/v1/README.md b/proto/api/v1/README.md new file mode 100644 index 00000000..09b7b3d6 --- /dev/null +++ b/proto/api/v1/README.md @@ -0,0 +1,3 @@ +# Memos API Design + +This API design should follow the guidelines and best practices outlined in the [Google API Improvement Proposals (AIPs)](https://google.aip.dev/). diff --git a/server/router/api/v1/workspace_setting_service.go b/server/router/api/v1/workspace_setting_service.go index 1ea2f0f0..f72b4947 100644 --- a/server/router/api/v1/workspace_setting_service.go +++ b/server/router/api/v1/workspace_setting_service.go @@ -70,12 +70,6 @@ func (s *APIV1Service) SetWorkspaceSetting(ctx context.Context, request *v1pb.Se } updateSetting := convertWorkspaceSettingToStore(request.Setting) - // Don't allow to update workspace general setting in demo mode. - // Such as disallow user registration, disallow password auth, etc. - if s.Profile.Mode == "demo" && updateSetting.Key == storepb.WorkspaceSettingKey_GENERAL { - return nil, status.Errorf(codes.InvalidArgument, "setting workspace setting is not allowed in demo mode") - } - workspaceSetting, err := s.Store.UpsertWorkspaceSetting(ctx, updateSetting) if err != nil { return nil, status.Errorf(codes.Internal, "failed to upsert workspace setting: %v", err) diff --git a/web/src/components/Settings/WorkspaceSection.tsx b/web/src/components/Settings/WorkspaceSection.tsx index 7660f37b..81a2b24a 100644 --- a/web/src/components/Settings/WorkspaceSection.tsx +++ b/web/src/components/Settings/WorkspaceSection.tsx @@ -120,6 +120,7 @@ const WorkspaceSection = () => {
{t("setting.workspace-section.disallow-user-registration")} updatePartialSetting({ disallowUserRegistration: event.target.checked })} /> @@ -127,7 +128,7 @@ const WorkspaceSection = () => {
{t("setting.workspace-section.disallow-password-auth")} updatePartialSetting({ disallowPasswordAuth: event.target.checked })} />