Debian Codegraph @

src/models/features.js

raw
1 /* exported FlatpakFeaturesModel */
2
3 /* features.js
4 *
5 * Copyright 2020 Martin Abente Lahaye
6 *
7 * This program is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation, either version 3 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
21 const {GObject} = imports.gi;
22
23 const {FlatpakSharedModel} = imports.models.shared;
24
25
26 var FlatpakFeaturesModel = GObject.registerClass({
27 GTypeName: 'FlatpakFeaturesModel',
28 }, class FlatpakFeaturesModel extends FlatpakSharedModel {
29 _init() {
30 super._init({});
31 }
32
33 getPermissions() {
34 return {
35 'features-devel': {
36 supported: this._info.supports('0.6.10'),
37 description: _('Development syscalls (e.g. ptrace)'),
38 option: 'devel',
39 value: this.constructor.getDefault(),
40 example: 'allow=devel',
41 },
42 'features-multiarch': {
43 supported: this._info.supports('0.6.12'),
44 description: _('Programs from other architectures'),
45 option: 'multiarch',
46 value: this.constructor.getDefault(),
47 example: 'allow=multiarch',
48 },
49 'features-bluetooth': {
50 supported: this._info.supports('0.11.8'),
51 description: _('Bluetooth'),
52 option: 'bluetooth',
53 value: this.constructor.getDefault(),
54 example: 'allow=bluetooth',
55 },
56 'features-canbus': {
57 supported: this._info.supports('1.0.3'),
58 description: _('Controller Area Network bus'),
59 option: 'canbus',
60 value: this.constructor.getDefault(),
61 example: 'allow=canbus',
62 },
63 'features-per-app-dev-shm': {
64 supported: this._info.supports('1.11.1'),
65 description: _('Application Shared Memory'),
66 option: 'per-app-dev-shm',
67 value: this.constructor.getDefault(),
68 example: 'allow=per-app-dev-shm',
69 },
70 };
71 }
72
73 static getGroup() {
74 return 'Context';
75 }
76
77 static getKey() {
78 return 'features';
79 }
80
81 static getStyle() {
82 return 'features';
83 }
84
85 static getTitle() {
86 return 'Allow';
87 }
88
89 static getDescription() {
90 return _('List of features available to the application');
91 }
92 });