Skip to content

Commit f6f758a

Browse files
committed
set world_readable to reflect value of sharing in config
1 parent cc9b9ed commit f6f758a

File tree

1 file changed

+19
-2
lines changed

1 file changed

+19
-2
lines changed

plotly/plotlyfig.m

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
obj.PlotOptions.CleanFeedTitle = true;
5454
obj.PlotOptions.FileName = '';
5555
obj.PlotOptions.FileOpt = 'new';
56-
obj.PlotOptions.WorldReadable = true;
56+
obj.PlotOptions.WorldReadable = obj.get_sharing;
5757
obj.PlotOptions.ShowURL = true;
5858
obj.PlotOptions.OpenURL = true;
5959
obj.PlotOptions.Strip = true;
@@ -887,6 +887,23 @@ function delete(obj)
887887
link_domain = strrep(plotly_domain, 'https://', '');
888888
link_domain = strrep(link_domain, 'http://', '');
889889
link_text = ['Export to ' link_domain];
890-
end
890+
end
891+
892+
function sharing_value = get_sharing(obj)
893+
config = loadplotlyconfig();
894+
config = config.sharing;
895+
if ~isempty(config)
896+
if strcmp(config, 'private')
897+
sharing_value = false;
898+
elseif strcmp(config, 'secret')
899+
warning('Secret share keys are not currently supported in the MATLAB API.')
900+
sharing_value = false;
901+
else
902+
sharing_value = true;
903+
end
904+
else
905+
sharing_value = true;
906+
end
907+
end
891908
end
892909
end

0 commit comments

Comments
 (0)