mirror of
https://github.com/aykhans/slash-e.git
synced 2025-07-04 04:23:16 +00:00
feat: add workspace security setting definition
This commit is contained in:
@ -29,6 +29,12 @@ func (d *DB) UpsertWorkspaceSetting(ctx context.Context, upsert *storepb.Workspa
|
||||
return nil, err
|
||||
}
|
||||
valueString = string(valueBytes)
|
||||
} else if upsert.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SECURITY {
|
||||
valueBytes, err := protojson.Marshal(upsert.GetSecurity())
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
valueString = string(valueBytes)
|
||||
} else if upsert.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SHORTCUT_RELATED {
|
||||
valueBytes, err := protojson.Marshal(upsert.GetShortcutRelated())
|
||||
if err != nil {
|
||||
@ -92,6 +98,14 @@ func (d *DB) ListWorkspaceSettings(ctx context.Context, find *store.FindWorkspac
|
||||
workspaceSetting.Value = &storepb.WorkspaceSetting_General{
|
||||
General: workspaceSettingGeneral,
|
||||
}
|
||||
} else if workspaceSetting.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SECURITY {
|
||||
workspaceSettingSecurity := &storepb.WorkspaceSetting_SecuritySetting{}
|
||||
if err := protojsonUnmarshaler.Unmarshal([]byte(valueString), workspaceSettingSecurity); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
workspaceSetting.Value = &storepb.WorkspaceSetting_Security{
|
||||
Security: workspaceSettingSecurity,
|
||||
}
|
||||
} else if workspaceSetting.Key == storepb.WorkspaceSettingKey_WORKSPACE_SETTING_SHORTCUT_RELATED {
|
||||
workspaceSettingShortcutRelated := &storepb.WorkspaceSetting_ShortcutRelatedSetting{}
|
||||
if err := protojsonUnmarshaler.Unmarshal([]byte(valueString), workspaceSettingShortcutRelated); err != nil {
|
||||
|
Reference in New Issue
Block a user