@e280/quay
Version:
File-browser and outliner UI for the web
26 lines • 884 B
JavaScript
var PermissionKey;
(function (PermissionKey) {
PermissionKey["rename"] = "rename";
PermissionKey["move"] = "move";
PermissionKey["delete"] = "delete";
PermissionKey["refresh"] = "refresh";
PermissionKey["newFolder"] = "newFolder";
PermissionKey["search"] = "search";
PermissionKey["upload"] = "upload";
})(PermissionKey || (PermissionKey = {}));
const ALL_KEYS = Object.values(PermissionKey);
function makePermissions(defaultValue, overrides = {}) {
const perms = {};
for (const key of ALL_KEYS)
perms[key] = key in overrides ? overrides[key] : defaultValue;
return perms;
}
export const Permissions = {
all: makePermissions(true),
readOnly: makePermissions(false, {
[PermissionKey.refresh]: true,
[PermissionKey.search]: true,
}),
none: makePermissions(false),
};
//# sourceMappingURL=permissions.js.map