@webiny/app-security-access-management 5.20.0 → 5.21.0-beta.0

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/index.d.ts CHANGED
@@ -1,2 +1,5 @@
1
- declare const _default: () => import("@webiny/plugins/types").PluginCollection;
1
+ import React from "react";
2
+ declare const _default: () => any[];
2
3
  export default _default;
4
+ export declare const AccessManagementExtension: () => JSX.Element;
5
+ export declare const AccessManagement: React.MemoExoticComponent<() => JSX.Element>;
package/index.js CHANGED
@@ -1,4 +1,49 @@
1
- import plugins from "./plugins";
1
+ import React, { memo } from "react";
2
+ import { plugins } from "@webiny/plugins";
3
+ import { Layout, Plugins, AddMenu, AddRoute } from "@webiny/app-admin";
4
+ import { HasPermission } from "@webiny/app-security";
5
+ import { Permission } from "./plugins/constants";
6
+ import { Groups } from "./ui/views/Groups";
7
+ import { ApiKeys } from "./ui/views/ApiKeys";
8
+ import accessManagementPugins from "./plugins";
2
9
  export default (function () {
3
- return plugins();
4
- });
10
+ return [];
11
+ });
12
+ export var AccessManagementExtension = function AccessManagementExtension() {
13
+ plugins.register(accessManagementPugins());
14
+ return /*#__PURE__*/React.createElement(Plugins, null, /*#__PURE__*/React.createElement(HasPermission, {
15
+ name: Permission.Groups
16
+ }, /*#__PURE__*/React.createElement(AddRoute, {
17
+ exact: true,
18
+ path: "/access-management/groups"
19
+ }, /*#__PURE__*/React.createElement(Layout, {
20
+ title: "Access Management - Groups"
21
+ }, /*#__PURE__*/React.createElement(Groups, null)))), /*#__PURE__*/React.createElement(HasPermission, {
22
+ name: Permission.ApiKeys
23
+ }, /*#__PURE__*/React.createElement(AddRoute, {
24
+ exact: true,
25
+ path: "/access-management/api-keys"
26
+ }, /*#__PURE__*/React.createElement(Layout, {
27
+ title: "Access Management - API Keys"
28
+ }, /*#__PURE__*/React.createElement(ApiKeys, null)))), /*#__PURE__*/React.createElement(HasPermission, {
29
+ any: [Permission.Groups, Permission.ApiKeys]
30
+ }, /*#__PURE__*/React.createElement(AddMenu, {
31
+ name: "settings"
32
+ }, /*#__PURE__*/React.createElement(AddMenu, {
33
+ name: "settings.accessManagement",
34
+ label: "Access Management"
35
+ }, /*#__PURE__*/React.createElement(HasPermission, {
36
+ name: Permission.Groups
37
+ }, /*#__PURE__*/React.createElement(AddMenu, {
38
+ name: "settings.accessManagement.groups",
39
+ label: "Groups",
40
+ path: "/access-management/groups"
41
+ })), /*#__PURE__*/React.createElement(HasPermission, {
42
+ name: Permission.ApiKeys
43
+ }, /*#__PURE__*/React.createElement(AddMenu, {
44
+ name: "settings.accessManagement.apiKeys",
45
+ label: "API Keys",
46
+ path: "/access-management/api-keys"
47
+ }))))));
48
+ };
49
+ export var AccessManagement = /*#__PURE__*/memo(AccessManagementExtension);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webiny/app-security-access-management",
3
- "version": "5.20.0",
3
+ "version": "5.21.0-beta.0",
4
4
  "main": "index.js",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,14 +15,14 @@
15
15
  "dependencies": {
16
16
  "@apollo/react-hooks": "3.1.5",
17
17
  "@emotion/styled": "10.0.27",
18
- "@webiny/app": "5.20.0",
19
- "@webiny/app-admin": "5.20.0",
20
- "@webiny/app-security": "5.20.0",
21
- "@webiny/form": "5.20.0",
22
- "@webiny/plugins": "5.20.0",
23
- "@webiny/react-router": "5.20.0",
24
- "@webiny/ui": "5.20.0",
25
- "@webiny/validation": "5.20.0",
18
+ "@webiny/app": "5.21.0-beta.0",
19
+ "@webiny/app-admin": "5.21.0-beta.0",
20
+ "@webiny/app-security": "5.21.0-beta.0",
21
+ "@webiny/form": "5.21.0-beta.0",
22
+ "@webiny/plugins": "5.21.0-beta.0",
23
+ "@webiny/react-router": "5.21.0-beta.0",
24
+ "@webiny/ui": "5.21.0-beta.0",
25
+ "@webiny/validation": "5.21.0-beta.0",
26
26
  "emotion": "10.0.27",
27
27
  "graphql-tag": "2.12.6",
28
28
  "lodash": "4.17.21",
@@ -37,8 +37,8 @@
37
37
  "@babel/preset-env": "^7.5.5",
38
38
  "@babel/preset-react": "^7.0.0",
39
39
  "@babel/preset-typescript": "^7.8.3",
40
- "@webiny/cli": "^5.20.0",
41
- "@webiny/project-utils": "^5.20.0",
40
+ "@webiny/cli": "^5.21.0-beta.0",
41
+ "@webiny/project-utils": "^5.21.0-beta.0",
42
42
  "babel-plugin-emotion": "^9.2.8",
43
43
  "babel-plugin-lodash": "^3.3.4",
44
44
  "babel-plugin-named-asset-import": "^1.0.0-next.3e165448",
@@ -66,5 +66,5 @@
66
66
  ]
67
67
  }
68
68
  },
69
- "gitHead": "816632961750d4ae7f3af0d32d4e8a46c3f287a6"
69
+ "gitHead": "cad155812edbdd577a1cc858b41038fdd7a6d2d9"
70
70
  }
package/plugins/index.js CHANGED
@@ -1,8 +1,6 @@
1
- import routes from "./routes";
2
- import menus from "./menus";
3
1
  import installation from "./installation";
4
2
  import permissionRenderer from "./permissionRenderer";
5
3
  import secureRouteError from "./secureRouteError";
6
4
  export default (function () {
7
- return [routes, menus, installation, permissionRenderer, secureRouteError];
5
+ return [installation, permissionRenderer, secureRouteError];
8
6
  });
@@ -1,4 +0,0 @@
1
- import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
2
- import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
3
- declare const _default: UIViewPlugin<NavigationView>;
4
- export default _default;
package/plugins/menus.js DELETED
@@ -1,61 +0,0 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { NavigationMenuElement, TAGS } from "@webiny/app-admin/ui/elements/NavigationMenuElement";
4
- import { Permission } from "./constants";
5
- import { UIViewPlugin } from "@webiny/app-admin/ui/UIView";
6
- import { NavigationView } from "@webiny/app-admin/ui/views/NavigationView";
7
- export default new UIViewPlugin(NavigationView, /*#__PURE__*/function () {
8
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(view) {
9
- var _view$getSecurityHook, identity, groups, apiKeys, mainMenu;
10
-
11
- return _regeneratorRuntime.wrap(function _callee$(_context) {
12
- while (1) {
13
- switch (_context.prev = _context.next) {
14
- case 0:
15
- _context.next = 2;
16
- return view.isRendered();
17
-
18
- case 2:
19
- _view$getSecurityHook = view.getSecurityHook(), identity = _view$getSecurityHook.identity;
20
- groups = identity.getPermission(Permission.Groups);
21
- apiKeys = identity.getPermission(Permission.ApiKeys);
22
-
23
- if (!(!groups && !apiKeys)) {
24
- _context.next = 7;
25
- break;
26
- }
27
-
28
- return _context.abrupt("return");
29
-
30
- case 7:
31
- mainMenu = view.getSettingsMenuElement().addElement(new NavigationMenuElement("accessManagement", {
32
- label: "Access Management",
33
- tags: [TAGS.UTILS]
34
- }));
35
-
36
- if (groups) {
37
- mainMenu.addElement(new NavigationMenuElement("groups", {
38
- label: "Groups",
39
- path: "/access-management/groups"
40
- }));
41
- }
42
-
43
- if (apiKeys) {
44
- mainMenu.addElement(new NavigationMenuElement("apiKeys", {
45
- label: "API Keys",
46
- path: "/access-management/api-keys"
47
- }));
48
- }
49
-
50
- case 10:
51
- case "end":
52
- return _context.stop();
53
- }
54
- }
55
- }, _callee);
56
- }));
57
-
58
- return function (_x) {
59
- return _ref.apply(this, arguments);
60
- };
61
- }());