screenshot: Respect lockdown settings

We allow users/admins to lock down disk writes, respect that when
taking screenshots.

https://bugzilla.gnome.org/show_bug.cgi?id=737846
This commit is contained in:
Florian Müllner 2014-10-03 16:33:37 +02:00
parent dd42cfa853
commit f9d909f985

View File

@ -67,12 +67,15 @@ const ScreenshotService = new Lang.Class({
this._screenShooter = new Map(); this._screenShooter = new Map();
this._lockdownSettings = new Gio.Settings({ schema_id: 'org.gnome.desktop.lockdown' });
Gio.DBus.session.own_name('org.gnome.Shell.Screenshot', Gio.BusNameOwnerFlags.REPLACE, null, null); Gio.DBus.session.own_name('org.gnome.Shell.Screenshot', Gio.BusNameOwnerFlags.REPLACE, null, null);
}, },
_createScreenshot: function(invocation) { _createScreenshot: function(invocation) {
let sender = invocation.get_sender(); let sender = invocation.get_sender();
if (this._screenShooter.has(sender)) { if (this._screenShooter.has(sender) ||
this._lockdownSettings.get_boolean('disable-save-to-disk')) {
invocation.return_value(GLib.Variant.new('(bs)', [false, ''])); invocation.return_value(GLib.Variant.new('(bs)', [false, '']));
return null; return null;
} }