solid-ui 2.4.14-46ae8b5d → 2.4.14-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE.md +0 -0
- package/README.md +0 -0
- package/lib/acl/access-controller.d.ts +0 -0
- package/lib/acl/access-controller.d.ts.map +0 -0
- package/lib/acl/access-controller.js +334 -441
- package/lib/acl/access-controller.js.map +1 -1
- package/lib/acl/access-groups.d.ts +1 -1
- package/lib/acl/access-groups.d.ts.map +1 -1
- package/lib/acl/access-groups.js +347 -492
- package/lib/acl/access-groups.js.map +1 -1
- package/lib/acl/acl-control.d.ts +0 -0
- package/lib/acl/acl-control.d.ts.map +0 -0
- package/lib/acl/acl-control.js +168 -198
- package/lib/acl/acl-control.js.map +1 -1
- package/lib/acl/acl.d.ts +1 -1
- package/lib/acl/acl.d.ts.map +1 -1
- package/lib/acl/acl.js +444 -459
- package/lib/acl/acl.js.map +1 -1
- package/lib/acl/add-agent-buttons.d.ts +0 -0
- package/lib/acl/add-agent-buttons.d.ts.map +0 -0
- package/lib/acl/add-agent-buttons.js +318 -515
- package/lib/acl/add-agent-buttons.js.map +1 -1
- package/lib/acl/index.d.ts +0 -0
- package/lib/acl/index.d.ts.map +0 -0
- package/lib/acl/index.js +27 -35
- package/lib/acl/index.js.map +1 -1
- package/lib/acl/styles.d.ts +0 -0
- package/lib/acl/styles.d.ts.map +0 -0
- package/lib/acl/styles.js +84 -90
- package/lib/acl/styles.js.map +1 -1
- package/lib/acl/types.d.ts +0 -0
- package/lib/acl/types.d.ts.map +0 -0
- package/lib/acl/types.js +5 -4
- package/lib/acl/types.js.map +1 -1
- package/lib/authn/authSession.d.ts +0 -0
- package/lib/authn/authSession.d.ts.map +0 -0
- package/lib/authn/authSession.js +14 -21
- package/lib/authn/authSession.js.map +1 -1
- package/lib/authn/authn.d.ts +0 -0
- package/lib/authn/authn.d.ts.map +0 -0
- package/lib/authn/authn.js +1391 -1935
- package/lib/authn/authn.js.map +1 -1
- package/lib/authn/config-default.js +0 -0
- package/lib/authn/config-default.js.map +0 -0
- package/lib/authn/index.d.ts +0 -0
- package/lib/authn/index.d.ts.map +0 -0
- package/lib/authn/index.js +26 -37
- package/lib/authn/index.js.map +1 -1
- package/lib/authn/signup.js +0 -0
- package/lib/authn/signup.js.map +0 -0
- package/lib/authn/types.d.ts +0 -0
- package/lib/authn/types.d.ts.map +0 -0
- package/lib/authn/types.js +1 -4
- package/lib/authn/types.js.map +1 -1
- package/lib/chat/bookmarks.js +0 -0
- package/lib/chat/bookmarks.js.map +0 -0
- package/lib/chat/dateFolder.js +0 -0
- package/lib/chat/dateFolder.js.map +0 -0
- package/lib/chat/infinite.js +0 -0
- package/lib/chat/infinite.js.map +0 -0
- package/lib/chat/message.js +0 -0
- package/lib/chat/message.js.map +0 -0
- package/lib/chat/messageTools.js +0 -0
- package/lib/chat/messageTools.js.map +0 -0
- package/lib/chat/thread.js +0 -0
- package/lib/chat/thread.js.map +0 -0
- package/lib/create/create.d.ts +0 -0
- package/lib/create/create.d.ts.map +0 -0
- package/lib/create/create.js +209 -214
- package/lib/create/create.js.map +1 -1
- package/lib/create/index.d.ts +0 -0
- package/lib/create/index.d.ts.map +0 -0
- package/lib/create/index.js +4 -10
- package/lib/create/index.js.map +1 -1
- package/lib/create/types.d.ts +0 -0
- package/lib/create/types.d.ts.map +0 -0
- package/lib/create/types.js +1 -4
- package/lib/create/types.js.map +1 -1
- package/lib/debug.d.ts +0 -0
- package/lib/debug.d.ts.map +0 -0
- package/lib/debug.js +30 -28
- package/lib/debug.js.map +1 -1
- package/lib/folders.js +0 -0
- package/lib/folders.js.map +0 -0
- package/lib/footer/index.d.ts +0 -0
- package/lib/footer/index.d.ts.map +0 -0
- package/lib/footer/index.js +109 -126
- package/lib/footer/index.js.map +1 -1
- package/lib/footer/styleMap.d.ts +0 -0
- package/lib/footer/styleMap.d.ts.map +0 -0
- package/lib/footer/styleMap.js +7 -11
- package/lib/footer/styleMap.js.map +1 -1
- package/lib/header/empty-profile.d.ts +0 -0
- package/lib/header/empty-profile.d.ts.map +0 -0
- package/lib/header/empty-profile.js +2 -6
- package/lib/header/empty-profile.js.map +1 -1
- package/lib/header/index.d.ts +0 -0
- package/lib/header/index.d.ts.map +0 -0
- package/lib/header/index.js +285 -361
- package/lib/header/index.js.map +1 -1
- package/lib/header/styleMap.d.ts +0 -0
- package/lib/header/styleMap.d.ts.map +0 -0
- package/lib/header/styleMap.js +116 -132
- package/lib/header/styleMap.js.map +1 -1
- package/lib/iconBase.d.ts +0 -0
- package/lib/iconBase.d.ts.map +0 -0
- package/lib/iconBase.js +23 -30
- package/lib/iconBase.js.map +1 -1
- package/lib/icons/solid_logo.d.ts +0 -0
- package/lib/icons/solid_logo.d.ts.map +0 -0
- package/lib/icons/solid_logo.js +0 -0
- package/lib/icons/solid_logo.js.map +1 -1
- package/lib/index.d.ts +0 -0
- package/lib/index.d.ts.map +0 -0
- package/lib/index.js +103 -207
- package/lib/index.js.map +1 -1
- package/lib/jss/index.d.ts +0 -0
- package/lib/jss/index.d.ts.map +0 -0
- package/lib/jss/index.js +21 -30
- package/lib/jss/index.js.map +1 -1
- package/lib/log.d.ts +0 -0
- package/lib/log.d.ts.map +0 -0
- package/lib/log.js +83 -131
- package/lib/log.js.map +1 -1
- package/lib/logic.d.ts +0 -0
- package/lib/logic.d.ts.map +0 -0
- package/lib/logic.js +82 -69
- package/lib/logic.js.map +1 -1
- package/lib/matrix/index.d.ts +0 -0
- package/lib/matrix/index.d.ts.map +0 -0
- package/lib/matrix/index.js +4 -10
- package/lib/matrix/index.js.map +1 -1
- package/lib/matrix/matrix.d.ts +0 -0
- package/lib/matrix/matrix.d.ts.map +0 -0
- package/lib/matrix/matrix.js +210 -237
- package/lib/matrix/matrix.js.map +1 -1
- package/lib/matrix/types.d.ts +0 -0
- package/lib/matrix/types.d.ts.map +0 -0
- package/lib/matrix/types.js +1 -4
- package/lib/matrix/types.js.map +1 -1
- package/lib/media/index.d.ts +0 -0
- package/lib/media/index.d.ts.map +0 -0
- package/lib/media/index.js +5 -11
- package/lib/media/index.js.map +1 -1
- package/lib/media/media-capture.d.ts +0 -0
- package/lib/media/media-capture.d.ts.map +0 -0
- package/lib/media/media-capture.js +187 -181
- package/lib/media/media-capture.js.map +1 -1
- package/lib/messageArea.js +0 -0
- package/lib/messageArea.js.map +0 -0
- package/lib/noun_Camera_1618446_000000.js +0 -0
- package/lib/noun_Camera_1618446_000000.js.map +0 -0
- package/lib/ns.js +0 -0
- package/lib/ns.js.map +0 -0
- package/lib/pad.d.ts +0 -0
- package/lib/pad.d.ts.map +0 -0
- package/lib/pad.js +794 -954
- package/lib/pad.js.map +1 -1
- package/lib/participation.d.ts +0 -0
- package/lib/participation.d.ts.map +0 -0
- package/lib/participation.js +170 -199
- package/lib/participation.js.map +1 -1
- package/lib/preferences.js +0 -0
- package/lib/preferences.js.map +0 -0
- package/lib/stories/decorators.js +0 -0
- package/lib/stories/decorators.js.map +0 -0
- package/lib/style.js +0 -0
- package/lib/style.js.map +0 -0
- package/lib/table.js +0 -0
- package/lib/table.js.map +0 -0
- package/lib/tabs.d.ts +0 -0
- package/lib/tabs.d.ts.map +0 -0
- package/lib/tabs.js +235 -342
- package/lib/tabs.js.map +1 -1
- package/lib/typings.d.js +0 -0
- package/lib/typings.d.js.map +0 -0
- package/lib/utils/headerFooterHelpers.d.ts +0 -0
- package/lib/utils/headerFooterHelpers.d.ts.map +0 -0
- package/lib/utils/headerFooterHelpers.js +130 -155
- package/lib/utils/headerFooterHelpers.js.map +1 -1
- package/lib/utils/index.js +0 -0
- package/lib/utils/index.js.map +0 -0
- package/lib/utils/label.d.ts +0 -0
- package/lib/utils/label.d.ts.map +0 -0
- package/lib/utils/label.js +121 -113
- package/lib/utils/label.js.map +1 -1
- package/lib/versionInfo.d.ts +0 -0
- package/lib/versionInfo.d.ts.map +0 -0
- package/lib/versionInfo.js +23 -28
- package/lib/versionInfo.js.map +1 -1
- package/lib/webpack-bundle.js +9 -9
- package/lib/webpack-bundle.js.map +1 -1
- package/lib/widgets/buttons/iconLinks.d.ts +0 -0
- package/lib/widgets/buttons/iconLinks.d.ts.map +0 -0
- package/lib/widgets/buttons/iconLinks.js +19 -30
- package/lib/widgets/buttons/iconLinks.js.map +1 -1
- package/lib/widgets/buttons.d.ts +0 -0
- package/lib/widgets/buttons.d.ts.map +0 -0
- package/lib/widgets/buttons.js +935 -1113
- package/lib/widgets/buttons.js.map +1 -1
- package/lib/widgets/dragAndDrop.js +0 -0
- package/lib/widgets/dragAndDrop.js.map +0 -0
- package/lib/widgets/error.d.ts +0 -0
- package/lib/widgets/error.d.ts.map +0 -0
- package/lib/widgets/error.js +18 -24
- package/lib/widgets/error.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/autocompleteBar.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/autocompleteBar.js +234 -325
- package/lib/widgets/forms/autocomplete/autocompleteBar.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompleteField.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/autocompleteField.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/autocompleteField.js +246 -276
- package/lib/widgets/forms/autocomplete/autocompleteField.js.map +1 -1
- package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/autocompletePicker.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/autocompletePicker.js +317 -497
- package/lib/widgets/forms/autocomplete/autocompletePicker.js.map +1 -1
- package/lib/widgets/forms/autocomplete/language.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/language.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/language.js +159 -212
- package/lib/widgets/forms/autocomplete/language.js.map +1 -1
- package/lib/widgets/forms/autocomplete/publicData.d.ts +0 -0
- package/lib/widgets/forms/autocomplete/publicData.d.ts.map +0 -0
- package/lib/widgets/forms/autocomplete/publicData.js +485 -718
- package/lib/widgets/forms/autocomplete/publicData.js.map +1 -1
- package/lib/widgets/forms/basic.d.ts +0 -0
- package/lib/widgets/forms/basic.d.ts.map +0 -0
- package/lib/widgets/forms/basic.js +208 -239
- package/lib/widgets/forms/basic.js.map +1 -1
- package/lib/widgets/forms/comment.d.ts +0 -0
- package/lib/widgets/forms/comment.d.ts.map +0 -0
- package/lib/widgets/forms/comment.js +48 -48
- package/lib/widgets/forms/comment.js.map +1 -1
- package/lib/widgets/forms/fieldFunction.d.ts +0 -0
- package/lib/widgets/forms/fieldFunction.d.ts.map +0 -0
- package/lib/widgets/forms/fieldFunction.js +31 -50
- package/lib/widgets/forms/fieldFunction.js.map +1 -1
- package/lib/widgets/forms/fieldParams.d.ts +0 -0
- package/lib/widgets/forms/fieldParams.d.ts.map +0 -0
- package/lib/widgets/forms/fieldParams.js +102 -81
- package/lib/widgets/forms/fieldParams.js.map +1 -1
- package/lib/widgets/forms/formStyle.d.ts +0 -0
- package/lib/widgets/forms/formStyle.d.ts.map +0 -0
- package/lib/widgets/forms/formStyle.js +52 -50
- package/lib/widgets/forms/formStyle.js.map +1 -1
- package/lib/widgets/forms.js +0 -0
- package/lib/widgets/forms.js.map +0 -0
- package/lib/widgets/index.js +0 -0
- package/lib/widgets/index.js.map +0 -0
- package/lib/widgets/peoplePicker.js +0 -0
- package/lib/widgets/peoplePicker.js.map +0 -0
- package/lib/widgets/widgetHelpers.d.ts +0 -0
- package/lib/widgets/widgetHelpers.d.ts.map +0 -0
- package/lib/widgets/widgetHelpers.js +18 -30
- package/lib/widgets/widgetHelpers.js.map +1 -1
- package/package.json +5 -4
package/lib/acl/access-groups.js
CHANGED
|
@@ -1,527 +1,382 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.AccessGroups = void 0;
|
|
11
|
-
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
13
|
-
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
15
|
-
|
|
16
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
17
|
-
|
|
18
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
19
|
-
|
|
20
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _rdflib = require("rdflib");
|
|
25
|
-
|
|
26
|
-
var _acl = require("./acl");
|
|
27
|
-
|
|
28
|
-
var widgets = _interopRequireWildcard(require("../widgets"));
|
|
29
|
-
|
|
30
|
-
var ns = _interopRequireWildcard(require("../ns"));
|
|
31
|
-
|
|
32
|
-
var _addAgentButtons = require("./add-agent-buttons");
|
|
33
|
-
|
|
34
|
-
var debug = _interopRequireWildcard(require("../debug"));
|
|
35
|
-
|
|
36
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
37
|
-
|
|
38
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
39
|
-
|
|
40
2
|
/**
|
|
41
3
|
* Contains the [[AccessGroups]]
|
|
42
4
|
* and [[AccessGroupsOptions]] classes
|
|
43
5
|
* @packageDocumentation
|
|
44
6
|
*/
|
|
7
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
8
|
+
if (k2 === undefined) k2 = k;
|
|
9
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
27
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
28
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
29
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
30
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
31
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
32
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
33
|
+
});
|
|
34
|
+
};
|
|
35
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
36
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
37
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
38
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
39
|
+
function step(op) {
|
|
40
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
41
|
+
while (_) try {
|
|
42
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
43
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
44
|
+
switch (op[0]) {
|
|
45
|
+
case 0: case 1: t = op; break;
|
|
46
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
47
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
48
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
49
|
+
default:
|
|
50
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
51
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
52
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
53
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
54
|
+
if (t[2]) _.ops.pop();
|
|
55
|
+
_.trys.pop(); continue;
|
|
56
|
+
}
|
|
57
|
+
op = body.call(thisArg, _);
|
|
58
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
59
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
63
|
+
exports.AccessGroups = void 0;
|
|
64
|
+
var rdflib_1 = require("rdflib");
|
|
65
|
+
var acl_1 = require("./acl");
|
|
66
|
+
var widgets = __importStar(require("../widgets"));
|
|
67
|
+
var ns = __importStar(require("../ns"));
|
|
68
|
+
var add_agent_buttons_1 = require("./add-agent-buttons");
|
|
69
|
+
var debug = __importStar(require("../debug"));
|
|
45
70
|
var ACL = ns.acl;
|
|
46
71
|
var COLLOQUIAL = {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
72
|
+
13: 'Owners',
|
|
73
|
+
9: 'Owners (write locked)',
|
|
74
|
+
5: 'Editors',
|
|
75
|
+
3: 'Posters',
|
|
76
|
+
2: 'Submitters',
|
|
77
|
+
1: 'Viewers'
|
|
53
78
|
};
|
|
54
79
|
var RECOMMENDED = {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
80
|
+
13: true,
|
|
81
|
+
5: true,
|
|
82
|
+
3: true,
|
|
83
|
+
2: true,
|
|
84
|
+
1: true
|
|
60
85
|
};
|
|
61
86
|
var EXPLANATION = {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
87
|
+
13: 'can read, write, and control sharing.',
|
|
88
|
+
9: 'can read and control sharing, currently write-locked.',
|
|
89
|
+
5: 'can read and change information',
|
|
90
|
+
3: 'can add new information, and read but not change existing information',
|
|
91
|
+
2: 'can add new information but not read any',
|
|
92
|
+
1: 'can read but not change information'
|
|
68
93
|
};
|
|
69
|
-
/**
|
|
70
|
-
* Type for the options parameter of [[AccessGroups]]
|
|
71
|
-
*/
|
|
72
|
-
|
|
73
94
|
/**
|
|
74
95
|
* Renders the table of Owners, Editors, Posters, Submitters, Viewers
|
|
75
96
|
* for https://github.com/solid/userguide/blob/main/views/sharing/userguide.md
|
|
76
97
|
*/
|
|
77
|
-
var AccessGroups =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
this._store = store; // TODO hacky, find a better solution
|
|
96
|
-
|
|
97
|
-
this.aclMap = (0, _acl.readACL)(doc, aclDoc, store, this.defaults);
|
|
98
|
-
this.byCombo = (0, _acl.ACLbyCombination)(this.aclMap);
|
|
99
|
-
this.addAgentButton = new _addAgentButtons.AddAgentButtons(this);
|
|
100
|
-
this.rootElement = this.controller.dom.createElement('div');
|
|
101
|
-
this.rootElement.classList.add(this.controller.classes.accessGroupList);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
(0, _createClass2["default"])(AccessGroups, [{
|
|
105
|
-
key: "store",
|
|
106
|
-
get: function get() {
|
|
107
|
-
return this._store;
|
|
108
|
-
},
|
|
109
|
-
set: function set(store) {
|
|
110
|
-
this._store = store;
|
|
111
|
-
this.aclMap = (0, _acl.readACL)(this.doc, this.aclDoc, store, this.defaults);
|
|
112
|
-
this.byCombo = (0, _acl.ACLbyCombination)(this.aclMap);
|
|
113
|
-
}
|
|
114
|
-
}, {
|
|
115
|
-
key: "render",
|
|
116
|
-
value: function render() {
|
|
117
|
-
var _this = this;
|
|
118
|
-
|
|
119
|
-
this.rootElement.innerHTML = '';
|
|
120
|
-
this.renderGroups().forEach(function (group) {
|
|
121
|
-
return _this.rootElement.appendChild(group);
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
if (this.controller.isEditable) {
|
|
125
|
-
this.rootElement.appendChild(this.addAgentButton.render());
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
return this.rootElement;
|
|
98
|
+
var AccessGroups = /** @class */ (function () {
|
|
99
|
+
function AccessGroups(doc, aclDoc, controller, store, options) {
|
|
100
|
+
if (options === void 0) { options = {}; }
|
|
101
|
+
this.doc = doc;
|
|
102
|
+
this.aclDoc = aclDoc;
|
|
103
|
+
this.controller = controller;
|
|
104
|
+
this.options = options;
|
|
105
|
+
this.defaults = options.defaults || false;
|
|
106
|
+
(0, rdflib_1.fetcher)(store, {});
|
|
107
|
+
// The store will already have an updater at this point:
|
|
108
|
+
// store.updater = new UpdateManager(store)
|
|
109
|
+
this._store = store; // TODO hacky, find a better solution
|
|
110
|
+
this.aclMap = (0, acl_1.readACL)(doc, aclDoc, store, this.defaults);
|
|
111
|
+
this.byCombo = (0, acl_1.ACLbyCombination)(this.aclMap);
|
|
112
|
+
this.addAgentButton = new add_agent_buttons_1.AddAgentButtons(this);
|
|
113
|
+
this.rootElement = this.controller.dom.createElement('div');
|
|
114
|
+
this.rootElement.classList.add(this.controller.classes.accessGroupList);
|
|
129
115
|
}
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
116
|
+
Object.defineProperty(AccessGroups.prototype, "store", {
|
|
117
|
+
get: function () {
|
|
118
|
+
return this._store;
|
|
119
|
+
},
|
|
120
|
+
set: function (store) {
|
|
121
|
+
this._store = store;
|
|
122
|
+
this.aclMap = (0, acl_1.readACL)(this.doc, this.aclDoc, store, this.defaults);
|
|
123
|
+
this.byCombo = (0, acl_1.ACLbyCombination)(this.aclMap);
|
|
124
|
+
},
|
|
125
|
+
enumerable: false,
|
|
126
|
+
configurable: true
|
|
127
|
+
});
|
|
128
|
+
AccessGroups.prototype.render = function () {
|
|
129
|
+
var _this = this;
|
|
130
|
+
this.rootElement.innerHTML = '';
|
|
131
|
+
this.renderGroups().forEach(function (group) { return _this.rootElement.appendChild(group); });
|
|
132
|
+
if (this.controller.isEditable) {
|
|
133
|
+
this.rootElement.appendChild(this.addAgentButton.render());
|
|
140
134
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
var groupRow = this.controller.dom.createElement('div');
|
|
151
|
-
groupRow.classList.add(this.controller.classes.accessGroupListItem);
|
|
152
|
-
widgets.makeDropTarget(groupRow, function (uris) {
|
|
153
|
-
return _this2.handleDroppedUris(uris, combo).then(function () {
|
|
154
|
-
return _this2.controller.render();
|
|
155
|
-
})["catch"](function (error) {
|
|
156
|
-
return _this2.controller.renderStatus(error);
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
var groupColumns = this.renderGroupElements(comboIndex, combo);
|
|
160
|
-
groupColumns.forEach(function (column) {
|
|
161
|
-
return groupRow.appendChild(column);
|
|
162
|
-
});
|
|
163
|
-
return groupRow;
|
|
164
|
-
}
|
|
165
|
-
}, {
|
|
166
|
-
key: "renderGroupElements",
|
|
167
|
-
value: function renderGroupElements(comboIndex, combo) {
|
|
168
|
-
var _this3 = this;
|
|
169
|
-
|
|
170
|
-
var groupNameColumn = this.controller.dom.createElement('div');
|
|
171
|
-
groupNameColumn.classList.add(this.controller.classes.group);
|
|
172
|
-
groupNameColumn.classList.toggle(this.controller.classes["group-".concat(comboIndex)], this.controller.isEditable);
|
|
173
|
-
groupNameColumn.innerText = COLLOQUIAL[comboIndex] || ktToList(comboIndex);
|
|
174
|
-
var groupAgentsColumn = this.controller.dom.createElement('div');
|
|
175
|
-
groupAgentsColumn.classList.add(this.controller.classes.group);
|
|
176
|
-
groupAgentsColumn.classList.toggle(this.controller.classes["group-".concat(comboIndex)], this.controller.isEditable);
|
|
177
|
-
var groupAgentsTable = groupAgentsColumn.appendChild(this.controller.dom.createElement('table'));
|
|
178
|
-
var combos = this.byCombo[combo] || [];
|
|
179
|
-
combos.map(function (_ref) {
|
|
180
|
-
var _ref2 = (0, _slicedToArray2["default"])(_ref, 2),
|
|
181
|
-
pred = _ref2[0],
|
|
182
|
-
obj = _ref2[1];
|
|
183
|
-
|
|
184
|
-
return _this3.renderAgent(groupAgentsTable, combo, pred, obj);
|
|
185
|
-
}).forEach(function (agentElement) {
|
|
186
|
-
return groupAgentsTable.appendChild(agentElement);
|
|
187
|
-
});
|
|
188
|
-
var groupDescriptionElement = this.controller.dom.createElement('div');
|
|
189
|
-
groupDescriptionElement.classList.add(this.controller.classes.group);
|
|
190
|
-
groupDescriptionElement.classList.toggle(this.controller.classes["group-".concat(comboIndex)], this.controller.isEditable);
|
|
191
|
-
groupDescriptionElement.innerText = EXPLANATION[comboIndex] || 'Unusual combination';
|
|
192
|
-
return [groupNameColumn, groupAgentsColumn, groupDescriptionElement];
|
|
193
|
-
}
|
|
194
|
-
}, {
|
|
195
|
-
key: "renderAgent",
|
|
196
|
-
value: function renderAgent(groupAgentsTable, combo, pred, obj) {
|
|
197
|
-
var _this4 = this;
|
|
198
|
-
|
|
199
|
-
var personRow = widgets.personTR(this.controller.dom, ACL(pred), (0, _rdflib.sym)(obj), this.controller.isEditable ? {
|
|
200
|
-
deleteFunction: function deleteFunction() {
|
|
201
|
-
return _this4.deleteAgent(combo, pred, obj).then(function () {
|
|
202
|
-
return groupAgentsTable.removeChild(personRow);
|
|
203
|
-
})["catch"](function (error) {
|
|
204
|
-
return _this4.controller.renderStatus(error);
|
|
205
|
-
});
|
|
206
|
-
}
|
|
207
|
-
} : {});
|
|
208
|
-
return personRow;
|
|
209
|
-
}
|
|
210
|
-
}, {
|
|
211
|
-
key: "deleteAgent",
|
|
212
|
-
value: function () {
|
|
213
|
-
var _deleteAgent = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(combo, pred, obj) {
|
|
214
|
-
var combos, comboToRemove;
|
|
215
|
-
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
216
|
-
while (1) {
|
|
217
|
-
switch (_context.prev = _context.next) {
|
|
218
|
-
case 0:
|
|
219
|
-
combos = this.byCombo[combo] || [];
|
|
220
|
-
comboToRemove = combos.find(function (_ref3) {
|
|
221
|
-
var _ref4 = (0, _slicedToArray2["default"])(_ref3, 2),
|
|
222
|
-
comboPred = _ref4[0],
|
|
223
|
-
comboObj = _ref4[1];
|
|
224
|
-
|
|
225
|
-
return comboPred === pred && comboObj === obj;
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
if (comboToRemove) {
|
|
229
|
-
combos.splice(combos.indexOf(comboToRemove), 1);
|
|
230
|
-
}
|
|
231
|
-
|
|
232
|
-
_context.next = 5;
|
|
233
|
-
return this.controller.save();
|
|
234
|
-
|
|
235
|
-
case 5:
|
|
236
|
-
case "end":
|
|
237
|
-
return _context.stop();
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
}, _callee, this);
|
|
241
|
-
}));
|
|
242
|
-
|
|
243
|
-
function deleteAgent(_x, _x2, _x3) {
|
|
244
|
-
return _deleteAgent.apply(this, arguments);
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
return deleteAgent;
|
|
248
|
-
}()
|
|
249
|
-
}, {
|
|
250
|
-
key: "addNewURI",
|
|
251
|
-
value: function () {
|
|
252
|
-
var _addNewURI = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(uri) {
|
|
253
|
-
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
254
|
-
while (1) {
|
|
255
|
-
switch (_context2.prev = _context2.next) {
|
|
256
|
-
case 0:
|
|
257
|
-
_context2.next = 2;
|
|
258
|
-
return this.handleDroppedUri(uri, kToCombo(1));
|
|
259
|
-
|
|
260
|
-
case 2:
|
|
261
|
-
_context2.next = 4;
|
|
262
|
-
return this.controller.save();
|
|
263
|
-
|
|
264
|
-
case 4:
|
|
265
|
-
case "end":
|
|
266
|
-
return _context2.stop();
|
|
135
|
+
return this.rootElement;
|
|
136
|
+
};
|
|
137
|
+
AccessGroups.prototype.renderGroups = function () {
|
|
138
|
+
var groupElements = [];
|
|
139
|
+
for (var comboIndex = 15; comboIndex > 0; comboIndex--) {
|
|
140
|
+
var combo = kToCombo(comboIndex);
|
|
141
|
+
if ((this.controller.isEditable && RECOMMENDED[comboIndex]) || this.byCombo[combo]) {
|
|
142
|
+
groupElements.push(this.renderGroup(comboIndex, combo));
|
|
267
143
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
return
|
|
144
|
+
}
|
|
145
|
+
return groupElements;
|
|
146
|
+
};
|
|
147
|
+
AccessGroups.prototype.renderGroup = function (comboIndex, combo) {
|
|
148
|
+
var _this = this;
|
|
149
|
+
var groupRow = this.controller.dom.createElement('div');
|
|
150
|
+
groupRow.classList.add(this.controller.classes.accessGroupListItem);
|
|
151
|
+
widgets.makeDropTarget(groupRow, function (uris) { return _this.handleDroppedUris(uris, combo)
|
|
152
|
+
.then(function () { return _this.controller.render(); })
|
|
153
|
+
.catch(function (error) { return _this.controller.renderStatus(error); }); });
|
|
154
|
+
var groupColumns = this.renderGroupElements(comboIndex, combo);
|
|
155
|
+
groupColumns.forEach(function (column) { return groupRow.appendChild(column); });
|
|
156
|
+
return groupRow;
|
|
157
|
+
};
|
|
158
|
+
AccessGroups.prototype.renderGroupElements = function (comboIndex, combo) {
|
|
159
|
+
var _this = this;
|
|
160
|
+
var groupNameColumn = this.controller.dom.createElement('div');
|
|
161
|
+
groupNameColumn.classList.add(this.controller.classes.group);
|
|
162
|
+
groupNameColumn.classList.toggle(this.controller.classes["group-".concat(comboIndex)], this.controller.isEditable);
|
|
163
|
+
groupNameColumn.innerText = COLLOQUIAL[comboIndex] || ktToList(comboIndex);
|
|
164
|
+
var groupAgentsColumn = this.controller.dom.createElement('div');
|
|
165
|
+
groupAgentsColumn.classList.add(this.controller.classes.group);
|
|
166
|
+
groupAgentsColumn.classList.toggle(this.controller.classes["group-".concat(comboIndex)], this.controller.isEditable);
|
|
167
|
+
var groupAgentsTable = groupAgentsColumn.appendChild(this.controller.dom.createElement('table'));
|
|
168
|
+
var combos = this.byCombo[combo] || [];
|
|
169
|
+
combos
|
|
170
|
+
.map(function (_a) {
|
|
171
|
+
var pred = _a[0], obj = _a[1];
|
|
172
|
+
return _this.renderAgent(groupAgentsTable, combo, pred, obj);
|
|
173
|
+
})
|
|
174
|
+
.forEach(function (agentElement) { return groupAgentsTable.appendChild(agentElement); });
|
|
175
|
+
var groupDescriptionElement = this.controller.dom.createElement('div');
|
|
176
|
+
groupDescriptionElement.classList.add(this.controller.classes.group);
|
|
177
|
+
groupDescriptionElement.classList.toggle(this.controller.classes["group-".concat(comboIndex)], this.controller.isEditable);
|
|
178
|
+
groupDescriptionElement.innerText = EXPLANATION[comboIndex] || 'Unusual combination';
|
|
179
|
+
return [groupNameColumn, groupAgentsColumn, groupDescriptionElement];
|
|
180
|
+
};
|
|
181
|
+
AccessGroups.prototype.renderAgent = function (groupAgentsTable, combo, pred, obj) {
|
|
182
|
+
var _this = this;
|
|
183
|
+
var personRow = widgets.personTR(this.controller.dom, ACL(pred), (0, rdflib_1.sym)(obj), this.controller.isEditable
|
|
184
|
+
? {
|
|
185
|
+
deleteFunction: function () { return _this.deleteAgent(combo, pred, obj)
|
|
186
|
+
.then(function () { return groupAgentsTable.removeChild(personRow); })
|
|
187
|
+
.catch(function (error) { return _this.controller.renderStatus(error); }); }
|
|
310
188
|
}
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
while (1) {
|
|
333
|
-
switch (_context4.prev = _context4.next) {
|
|
334
|
-
case 0:
|
|
335
|
-
secondAttempt = _args4.length > 2 && _args4[2] !== undefined ? _args4[2] : false;
|
|
336
|
-
agent = findAgent(uri, this.store); // eg 'agent', 'origin', agentClass'
|
|
337
|
-
|
|
338
|
-
thing = (0, _rdflib.sym)(uri);
|
|
339
|
-
|
|
340
|
-
if (!(!agent && !secondAttempt)) {
|
|
341
|
-
_context4.next = 18;
|
|
342
|
-
break;
|
|
189
|
+
: {});
|
|
190
|
+
return personRow;
|
|
191
|
+
};
|
|
192
|
+
AccessGroups.prototype.deleteAgent = function (combo, pred, obj) {
|
|
193
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
194
|
+
var combos, comboToRemove;
|
|
195
|
+
return __generator(this, function (_a) {
|
|
196
|
+
switch (_a.label) {
|
|
197
|
+
case 0:
|
|
198
|
+
combos = this.byCombo[combo] || [];
|
|
199
|
+
comboToRemove = combos.find(function (_a) {
|
|
200
|
+
var comboPred = _a[0], comboObj = _a[1];
|
|
201
|
+
return comboPred === pred && comboObj === obj;
|
|
202
|
+
});
|
|
203
|
+
if (comboToRemove) {
|
|
204
|
+
combos.splice(combos.indexOf(comboToRemove), 1);
|
|
205
|
+
}
|
|
206
|
+
return [4 /*yield*/, this.controller.save()];
|
|
207
|
+
case 1:
|
|
208
|
+
_a.sent();
|
|
209
|
+
return [2 /*return*/];
|
|
343
210
|
}
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
211
|
+
});
|
|
212
|
+
});
|
|
213
|
+
};
|
|
214
|
+
AccessGroups.prototype.addNewURI = function (uri) {
|
|
215
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
216
|
+
return __generator(this, function (_a) {
|
|
217
|
+
switch (_a.label) {
|
|
218
|
+
case 0: return [4 /*yield*/, this.handleDroppedUri(uri, kToCombo(1))];
|
|
219
|
+
case 1:
|
|
220
|
+
_a.sent();
|
|
221
|
+
return [4 /*yield*/, this.controller.save()];
|
|
222
|
+
case 2:
|
|
223
|
+
_a.sent();
|
|
224
|
+
return [2 /*return*/];
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
});
|
|
228
|
+
};
|
|
229
|
+
AccessGroups.prototype.handleDroppedUris = function (uris, combo) {
|
|
230
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
231
|
+
var error_1;
|
|
232
|
+
var _this = this;
|
|
233
|
+
return __generator(this, function (_a) {
|
|
234
|
+
switch (_a.label) {
|
|
235
|
+
case 0:
|
|
236
|
+
_a.trys.push([0, 3, , 4]);
|
|
237
|
+
return [4 /*yield*/, Promise.all(uris.map(function (uri) { return _this.handleDroppedUri(uri, combo); }))];
|
|
238
|
+
case 1:
|
|
239
|
+
_a.sent();
|
|
240
|
+
return [4 /*yield*/, this.controller.save()];
|
|
241
|
+
case 2:
|
|
242
|
+
_a.sent();
|
|
243
|
+
return [3 /*break*/, 4];
|
|
244
|
+
case 3:
|
|
245
|
+
error_1 = _a.sent();
|
|
246
|
+
return [2 /*return*/, Promise.reject(error_1)];
|
|
247
|
+
case 4: return [2 /*return*/];
|
|
248
|
+
}
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
};
|
|
252
|
+
AccessGroups.prototype.handleDroppedUri = function (uri, combo, secondAttempt) {
|
|
253
|
+
if (secondAttempt === void 0) { secondAttempt = false; }
|
|
254
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
255
|
+
var agent, thing, error_2, message, error;
|
|
256
|
+
return __generator(this, function (_a) {
|
|
257
|
+
switch (_a.label) {
|
|
258
|
+
case 0:
|
|
259
|
+
agent = findAgent(uri, this.store) // eg 'agent', 'origin', agentClass'
|
|
260
|
+
;
|
|
261
|
+
thing = (0, rdflib_1.sym)(uri);
|
|
262
|
+
if (!(!agent && !secondAttempt)) return [3 /*break*/, 5];
|
|
263
|
+
debug.log(" Not obvious: looking up dropped thing ".concat(thing));
|
|
264
|
+
_a.label = 1;
|
|
265
|
+
case 1:
|
|
266
|
+
_a.trys.push([1, 3, , 4]);
|
|
267
|
+
return [4 /*yield*/, this._store.fetcher.load(thing.doc())];
|
|
268
|
+
case 2:
|
|
269
|
+
_a.sent();
|
|
270
|
+
return [3 /*break*/, 4];
|
|
271
|
+
case 3:
|
|
272
|
+
error_2 = _a.sent();
|
|
273
|
+
message = "Ignore error looking up dropped thing: ".concat(error_2);
|
|
274
|
+
debug.error(message);
|
|
275
|
+
return [2 /*return*/, Promise.reject(new Error(message))];
|
|
276
|
+
case 4: return [2 /*return*/, this.handleDroppedUri(uri, combo, true)];
|
|
277
|
+
case 5:
|
|
278
|
+
if (!agent) {
|
|
279
|
+
error = " Error: Drop fails to drop appropriate thing! ".concat(uri);
|
|
280
|
+
debug.error(error);
|
|
281
|
+
return [2 /*return*/, Promise.reject(new Error(error))];
|
|
282
|
+
}
|
|
283
|
+
_a.label = 6;
|
|
284
|
+
case 6:
|
|
285
|
+
this.setACLCombo(combo, uri, agent, this.controller.subject);
|
|
286
|
+
return [2 /*return*/];
|
|
287
|
+
}
|
|
288
|
+
});
|
|
289
|
+
});
|
|
290
|
+
};
|
|
291
|
+
AccessGroups.prototype.setACLCombo = function (combo, uri, res, subject) {
|
|
292
|
+
if (!(combo in this.byCombo)) {
|
|
293
|
+
this.byCombo[combo] = [];
|
|
294
|
+
}
|
|
295
|
+
this.removeAgentFromCombos(uri); // Combos are mutually distinct
|
|
296
|
+
this.byCombo[combo].push([res.pred, res.obj.uri]);
|
|
297
|
+
debug.log("ACL: setting access to ".concat(subject, " by ").concat(res.pred, ": ").concat(res.obj));
|
|
298
|
+
};
|
|
299
|
+
AccessGroups.prototype.removeAgentFromCombos = function (uri) {
|
|
300
|
+
for (var k = 0; k < 16; k++) {
|
|
301
|
+
var combos = this.byCombo[kToCombo(k)];
|
|
302
|
+
if (combos) {
|
|
303
|
+
for (var i = 0; i < combos.length; i++) {
|
|
304
|
+
while (i < combos.length && combos[i][1] === uri) {
|
|
305
|
+
combos.splice(i, 1);
|
|
306
|
+
}
|
|
368
307
|
}
|
|
369
|
-
|
|
370
|
-
error = " Error: Drop fails to drop appropriate thing! ".concat(uri);
|
|
371
|
-
debug.error(error);
|
|
372
|
-
return _context4.abrupt("return", Promise.reject(new Error(error)));
|
|
373
|
-
|
|
374
|
-
case 22:
|
|
375
|
-
this.setACLCombo(combo, uri, agent, this.controller.subject);
|
|
376
|
-
|
|
377
|
-
case 23:
|
|
378
|
-
case "end":
|
|
379
|
-
return _context4.stop();
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
}, _callee4, this, [[5, 10]]);
|
|
383
|
-
}));
|
|
384
|
-
|
|
385
|
-
function handleDroppedUri(_x7, _x8) {
|
|
386
|
-
return _handleDroppedUri.apply(this, arguments);
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
return handleDroppedUri;
|
|
390
|
-
}()
|
|
391
|
-
}, {
|
|
392
|
-
key: "setACLCombo",
|
|
393
|
-
value: function setACLCombo(combo, uri, res, subject) {
|
|
394
|
-
if (!(combo in this.byCombo)) {
|
|
395
|
-
this.byCombo[combo] = [];
|
|
396
|
-
}
|
|
397
|
-
|
|
398
|
-
this.removeAgentFromCombos(uri); // Combos are mutually distinct
|
|
399
|
-
|
|
400
|
-
this.byCombo[combo].push([res.pred, res.obj.uri]);
|
|
401
|
-
debug.log("ACL: setting access to ".concat(subject, " by ").concat(res.pred, ": ").concat(res.obj));
|
|
402
|
-
}
|
|
403
|
-
}, {
|
|
404
|
-
key: "removeAgentFromCombos",
|
|
405
|
-
value: function removeAgentFromCombos(uri) {
|
|
406
|
-
for (var k = 0; k < 16; k++) {
|
|
407
|
-
var combos = this.byCombo[kToCombo(k)];
|
|
408
|
-
|
|
409
|
-
if (combos) {
|
|
410
|
-
for (var i = 0; i < combos.length; i++) {
|
|
411
|
-
while (i < combos.length && combos[i][1] === uri) {
|
|
412
|
-
combos.splice(i, 1);
|
|
413
308
|
}
|
|
414
|
-
}
|
|
415
309
|
}
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
return AccessGroups;
|
|
420
|
-
}();
|
|
421
|
-
|
|
310
|
+
};
|
|
311
|
+
return AccessGroups;
|
|
312
|
+
}());
|
|
422
313
|
exports.AccessGroups = AccessGroups;
|
|
423
|
-
|
|
424
314
|
function kToCombo(k) {
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
315
|
+
var y = ['Read', 'Append', 'Write', 'Control'];
|
|
316
|
+
var combo = [];
|
|
317
|
+
for (var i = 0; i < 4; i++) {
|
|
318
|
+
if (k & (1 << i)) {
|
|
319
|
+
combo.push('http://www.w3.org/ns/auth/acl#' + y[i]);
|
|
320
|
+
}
|
|
431
321
|
}
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
combo.sort();
|
|
435
|
-
return combo.join('\n');
|
|
322
|
+
combo.sort();
|
|
323
|
+
return combo.join('\n');
|
|
436
324
|
}
|
|
437
|
-
|
|
438
325
|
function ktToList(k) {
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
326
|
+
var list = '';
|
|
327
|
+
var y = ['Read', 'Append', 'Write', 'Control'];
|
|
328
|
+
for (var i = 0; i < 4; i++) {
|
|
329
|
+
if (k & (1 << i)) {
|
|
330
|
+
list += y[i];
|
|
331
|
+
}
|
|
445
332
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
return list;
|
|
333
|
+
return list;
|
|
449
334
|
}
|
|
450
|
-
|
|
451
335
|
function findAgent(uri, kb) {
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
if (ns.vcard('Individual').uri in types || ns.foaf('Person').uri in types || ns.foaf('Agent').uri in types) {
|
|
499
|
-
var pref = kb.any(obj, ns.foaf('preferredURI'));
|
|
500
|
-
if (pref) return {
|
|
501
|
-
pred: 'agent',
|
|
502
|
-
obj: (0, _rdflib.sym)(pref)
|
|
503
|
-
};
|
|
504
|
-
return {
|
|
505
|
-
pred: 'agent',
|
|
506
|
-
obj: obj
|
|
507
|
-
};
|
|
508
|
-
}
|
|
509
|
-
|
|
510
|
-
if (ns.solid('AppProvider').uri in types) {
|
|
511
|
-
return {
|
|
512
|
-
pred: 'origin',
|
|
513
|
-
obj: obj
|
|
514
|
-
};
|
|
515
|
-
}
|
|
516
|
-
|
|
517
|
-
if (ns.solid('AppProviderClass').uri in types) {
|
|
518
|
-
return {
|
|
519
|
-
pred: 'originClass',
|
|
520
|
-
obj: obj
|
|
521
|
-
};
|
|
522
|
-
}
|
|
523
|
-
|
|
524
|
-
debug.log(' Triage fails for ' + uri);
|
|
525
|
-
return null;
|
|
336
|
+
var obj = (0, rdflib_1.sym)(uri);
|
|
337
|
+
var types = kb.findTypeURIs(obj);
|
|
338
|
+
for (var ty in types) {
|
|
339
|
+
debug.log(' drop object type includes: ' + ty);
|
|
340
|
+
}
|
|
341
|
+
// An Origin URI is one like https://fred.github.io eith no trailing slash
|
|
342
|
+
if (uri.startsWith('http') && uri.split('/').length === 3) {
|
|
343
|
+
// there is no third slash
|
|
344
|
+
return { pred: 'origin', obj: obj }; // The only way to know an origin alas
|
|
345
|
+
}
|
|
346
|
+
// @@ This is an almighty kludge needed because drag and drop adds extra slashes to origins
|
|
347
|
+
if (uri.startsWith('http') &&
|
|
348
|
+
uri.split('/').length === 4 &&
|
|
349
|
+
uri.endsWith('/')) {
|
|
350
|
+
// there IS third slash
|
|
351
|
+
debug.log('Assuming final slash on dragged origin URI was unintended!');
|
|
352
|
+
return { pred: 'origin', obj: (0, rdflib_1.sym)(uri.slice(0, -1)) }; // Fix a URI where the drag and drop system has added a spurious slash
|
|
353
|
+
}
|
|
354
|
+
if (ns.vcard('WebID').uri in types)
|
|
355
|
+
return { pred: 'agent', obj: obj };
|
|
356
|
+
if (ns.vcard('Group').uri in types) {
|
|
357
|
+
return { pred: 'agentGroup', obj: obj }; // @@ note vcard membership not RDFs
|
|
358
|
+
}
|
|
359
|
+
if (obj.sameTerm(ns.foaf('Agent')) ||
|
|
360
|
+
obj.sameTerm(ns.acl('AuthenticatedAgent')) || // AuthenticatedAgent
|
|
361
|
+
obj.sameTerm(ns.rdf('Resource')) ||
|
|
362
|
+
obj.sameTerm(ns.owl('Thing'))) {
|
|
363
|
+
return { pred: 'agentClass', obj: obj };
|
|
364
|
+
}
|
|
365
|
+
if (ns.vcard('Individual').uri in types ||
|
|
366
|
+
ns.foaf('Person').uri in types ||
|
|
367
|
+
ns.foaf('Agent').uri in types) {
|
|
368
|
+
var pref = kb.any(obj, ns.foaf('preferredURI'));
|
|
369
|
+
if (pref)
|
|
370
|
+
return { pred: 'agent', obj: (0, rdflib_1.sym)(pref) };
|
|
371
|
+
return { pred: 'agent', obj: obj };
|
|
372
|
+
}
|
|
373
|
+
if (ns.solid('AppProvider').uri in types) {
|
|
374
|
+
return { pred: 'origin', obj: obj };
|
|
375
|
+
}
|
|
376
|
+
if (ns.solid('AppProviderClass').uri in types) {
|
|
377
|
+
return { pred: 'originClass', obj: obj };
|
|
378
|
+
}
|
|
379
|
+
debug.log(' Triage fails for ' + uri);
|
|
380
|
+
return null;
|
|
526
381
|
}
|
|
527
382
|
//# sourceMappingURL=access-groups.js.map
|