@proteinjs/user-ui 1.3.1 → 1.4.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.
@@ -30,19 +30,19 @@ require("react-dom");
30
30
  require("react-helmet");
31
31
  require("react-router-dom");
32
32
  /** Generate Source Graph */
33
- var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"/Omit\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"forgotPasswordPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/pages/ForgotPassword.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/forgotPasswordPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/ui/Page\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"loginPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/pages/Login.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/loginPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"passwordResetPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/pages/PasswordReset.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/passwordResetPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/signupPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"signupPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/pages/Signup.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/signupPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"InviteRecordFormCustomization\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/form/InviteRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFormButtons\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFormButtons\",\"type\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"sendButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"revokeButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"isAdmin\",\"returnType\":{\"packageName\":\"\",\"name\":\"boolean\",\"filePath\":null,\"qualifiedName\":\"/boolean\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db-ui/RecordFormCustomization\"}],\"edges\":[{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/signupPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"}]}";
33
+ var sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"/Omit\"},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"InviteRecordFormCustomization\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/form/InviteRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFormButtons\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFormButtons\",\"type\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"sendButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"revokeButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"canManageUsers\",\"returnType\":{\"packageName\":\"\",\"name\":\"boolean\",\"filePath\":null,\"qualifiedName\":\"/boolean\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db-ui/RecordFormCustomization\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"forgotPasswordPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/pages/ForgotPassword.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/forgotPasswordPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/ui/Page\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"loginPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/pages/Login.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/loginPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"passwordResetPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/pages/PasswordReset.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/passwordResetPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/signupPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"signupPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/pages/Signup.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/signupPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}}],\"edges\":[{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/signupPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"}]}";
34
34
  /** Generate Source Links */
35
+ var InviteRecordFormCustomization_1 = require("../src/form/InviteRecordFormCustomization");
35
36
  var ForgotPassword_1 = require("../src/pages/ForgotPassword");
36
37
  var Login_1 = require("../src/pages/Login");
37
38
  var PasswordReset_1 = require("../src/pages/PasswordReset");
38
39
  var Signup_1 = require("../src/pages/Signup");
39
- var InviteRecordFormCustomization_1 = require("../src/form/InviteRecordFormCustomization");
40
40
  var sourceLinks = {
41
+ '@proteinjs/user-ui/InviteRecordFormCustomization': InviteRecordFormCustomization_1.InviteRecordFormCustomization,
41
42
  '@proteinjs/user-ui/forgotPasswordPage': ForgotPassword_1.forgotPasswordPage,
42
43
  '@proteinjs/user-ui/loginPage': Login_1.loginPage,
43
44
  '@proteinjs/user-ui/passwordResetPage': PasswordReset_1.passwordResetPage,
44
45
  '@proteinjs/user-ui/signupPage': Signup_1.signupPage,
45
- '@proteinjs/user-ui/InviteRecordFormCustomization': InviteRecordFormCustomization_1.InviteRecordFormCustomization,
46
46
  };
47
47
  /** Load Source Graph and Links */
48
48
  var reflection_1 = require("@proteinjs/reflection");
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,+BAA6B;AAC7B,yBAAuB;AACvB,yBAAuB;AACvB,4BAA0B;AAC1B,iCAA+B;AAC/B,iCAA+B;AAC/B,yBAAuB;AACvB,2BAAyB;AACzB,2BAAyB;AACzB,kBAAgB;AAChB,iBAAe;AACf,qBAAmB;AACnB,wBAAsB;AACtB,4BAA0B;AAG1B,4BAA4B;AAE5B,IAAM,WAAW,GAAG,0kOAA0kO,CAAC;AAG/lO,4BAA4B;AAE5B,8DAAiE;AACjE,4CAA+C;AAC/C,4DAA+D;AAC/D,8CAAiD;AACjD,2FAA0F;AAE1F,IAAM,WAAW,GAAG;IACnB,uCAAuC,EAAE,mCAAkB;IAC3D,8BAA8B,EAAE,iBAAS;IACzC,sCAAsC,EAAE,iCAAiB;IACzD,+BAA+B,EAAE,mBAAU;IAC3C,kDAAkD,EAAE,6DAA6B;CACjF,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../generated/index.ts"],"names":[],"mappings":";AAAA,oCAAoC;;;;;;;;;;;;;;;;AAEpC,+BAA6B;AAC7B,yBAAuB;AACvB,yBAAuB;AACvB,4BAA0B;AAC1B,iCAA+B;AAC/B,iCAA+B;AAC/B,yBAAuB;AACvB,2BAAyB;AACzB,2BAAyB;AACzB,kBAAgB;AAChB,iBAAe;AACf,qBAAmB;AACnB,wBAAsB;AACtB,4BAA0B;AAG1B,4BAA4B;AAE5B,IAAM,WAAW,GAAG,ilOAAilO,CAAC;AAGtmO,4BAA4B;AAE5B,2FAA0F;AAC1F,8DAAiE;AACjE,4CAA+C;AAC/C,4DAA+D;AAC/D,8CAAiD;AAEjD,IAAM,WAAW,GAAG;IACnB,kDAAkD,EAAE,6DAA6B;IACjF,uCAAuC,EAAE,mCAAkB;IAC3D,8BAA8B,EAAE,iBAAS;IACzC,sCAAsC,EAAE,iCAAiB;IACzD,+BAA+B,EAAE,mBAAU;CAC3C,CAAC;AAGF,kCAAkC;AAElC,oDAAyD;AACzD,6BAAgB,CAAC,KAAK,CAAC,WAAW,EAAE,WAAW,CAAC,CAAC;AAGjD,2CAAyB"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export * from './src/AuthenticatedPageContainer';
2
+ export * from './src/pageAuth';
2
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./src/AuthenticatedPageContainer"), exports);
18
+ __exportStar(require("./src/pageAuth"), exports);
18
19
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,iDAA+B"}
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticatedPageContainer.d.ts","sourceRoot":"","sources":["../../src/AuthenticatedPageContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAuB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAGxE,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAE/E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,qBA6ChF"}
1
+ {"version":3,"file":"AuthenticatedPageContainer.d.ts","sourceRoot":"","sources":["../../src/AuthenticatedPageContainer.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAiB,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAIlE,MAAM,MAAM,+BAA+B,GAAG,IAAI,CAAC,kBAAkB,EAAE,MAAM,CAAC,CAAC;AAE/E,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,+BAA+B,qBA+BhF"}
@@ -65,25 +65,14 @@ exports.AuthenticatedPageContainer = void 0;
65
65
  var react_1 = __importDefault(require("react"));
66
66
  var ui_1 = require("@proteinjs/ui");
67
67
  var user_1 = require("@proteinjs/user");
68
+ var pageAuth_1 = require("./pageAuth");
68
69
  function AuthenticatedPageContainer(props) {
69
70
  var _this = this;
70
71
  var other = __rest(props, []);
71
72
  var _a = react_1.default.useState(user_1.UserAuth.isLoggedIn()), isLoggedIn = _a[0], setIsLoggedIn = _a[1];
72
73
  return (react_1.default.createElement(ui_1.PageContainer, __assign({ auth: {
73
74
  isLoggedIn: isLoggedIn,
74
- canViewPage: function (page) {
75
- var _a, _b, _c, _d;
76
- if ((_a = page.auth) === null || _a === void 0 ? void 0 : _a.public) {
77
- return true;
78
- }
79
- if ((_b = page.auth) === null || _b === void 0 ? void 0 : _b.allUsers) {
80
- return user_1.UserAuth.isLoggedIn();
81
- }
82
- if (!((_c = page.auth) === null || _c === void 0 ? void 0 : _c.roles)) {
83
- return user_1.UserAuth.hasRole('admin');
84
- }
85
- return user_1.UserAuth.hasRoles((_d = page.auth) === null || _d === void 0 ? void 0 : _d.roles);
86
- },
75
+ canViewPage: pageAuth_1.canViewPage,
87
76
  login: user_1.uiRoutes.auth.login,
88
77
  logout: function () { return __awaiter(_this, void 0, void 0, function () {
89
78
  var response;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthenticatedPageContainer.js","sourceRoot":"","sources":["../../src/AuthenticatedPageContainer.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAA0B;AAC1B,oCAAwE;AACxE,wCAAkF;AAIlF,SAAgB,0BAA0B,CAAC,KAAsC;IAAjF,iBA6CC;IA5CC,IAAW,KAAK,UAAK,KAAK,EAApB,EAAY,CAAQ,CAAC;IACrB,IAAA,KAA8B,eAAK,CAAC,QAAQ,CAAC,eAAQ,CAAC,UAAU,EAAE,CAAC,EAAlE,UAAU,QAAA,EAAE,aAAa,QAAyC,CAAC;IAE1E,OAAO,CACL,8BAAC,kBAAa,aACZ,IAAI,EAAE;YACJ,UAAU,YAAA;YACV,WAAW,EAAE,UAAC,IAAU;;gBACtB,IAAI,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,EAAE;oBACrB,OAAO,IAAI,CAAC;iBACb;gBAED,IAAI,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,EAAE;oBACvB,OAAO,eAAQ,CAAC,UAAU,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AAK,EAApB,EAAY,CAAQ,CAAC;IACrB,IAAA,KAA8B,eAAK,CAAC,QAAQ,CAAC,eAAQ,CAAC,UAAU,EAAE,CAAC,EAAlE,UAAU,QAAA,EAAE,aAAa,QAAyC,CAAC;IAE1E,OAAO,CACL,8BAAC,kBAAa,aACZ,IAAI,EAAE;YACJ,UAAU,YAAA;YACV,WAAW,wBAAA;YACX,KAAK,EAAE,eAAQ,CAAC,IAAI,CAAC,KAAK;YAC1B,MAAM,EAAE;;;;gCACW,qBAAM,KAAK,CAAC,aAAM,CAAC,MAAM,CAAC,IAAI,EAAE;gCAC/C,MAAM,EAAE,aAAM,CAAC,MAAM,CAAC,MAAM;gCAC5B,QAAQ,EAAE,QAAQ;gCAClB,WAAW,EAAE,aAAa;gCAC1B,OAAO,EAAE;oCACP,cAAc,EAAE,kBAAkB;iCACnC;6BACF,CAAC,EAAA;;4BAPI,QAAQ,GAAG,SAOf;4BACF,IAAI,QAAQ,CAAC,MAAM,IAAI,GAAG,EAAE;gCAC1B,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;6BACtC;4BAED,IAAI,eAAQ,EAAE,CAAC,OAAO,CAAC,gBAAS,CAAC,CAAC;4BAClC,aAAa,CAAC,KAAK,CAAC,CAAC;4BACrB,sBAAO,eAAQ,CAAC,IAAI,CAAC,KAAK,EAAC;;;iBAC5B;SACF,IACG,KAAK,EACT,CACH,CAAC;AACJ,CAAC;AA/BD,gEA+BC"}
@@ -17,9 +17,10 @@ export declare class InviteRecordFormCustomization extends RecordFormCustomizati
17
17
  private sendButton;
18
18
  private revokeButton;
19
19
  /**
20
- * The same admin gate the standalone invite page carried, so these actions aren't offered to users
21
- * who can't perform them. `SignupService.serviceMetadata.auth` is what actually enforces it.
20
+ * The same 'users'-permission gate the service door carries, so these actions aren't offered to
21
+ * users who can't perform them. `SignupService.serviceMetadata.auth` is what actually enforces
22
+ * it; admin still passes via break-glass.
22
23
  */
23
- private isAdmin;
24
+ private canManageUsers;
24
25
  }
25
26
  //# sourceMappingURL=InviteRecordFormCustomization.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"InviteRecordFormCustomization.d.ts","sourceRoot":"","sources":["../../../src/form/InviteRecordFormCustomization.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAmB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAoB,MAAM,EAAoB,MAAM,iBAAiB,CAAC;AAG7E;;;;;;;;GAQG;AACH,qBAAa,6BAA8B,SAAQ,uBAAuB;IACjE,KAAK,wCAAiB;IAE7B,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE;IAK5G,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,kBAAkB,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;IASlG,OAAO,CAAC,UAAU;IA+BlB,OAAO,CAAC,YAAY;IAsBpB;;;OAGG;IACH,OAAO,CAAC,OAAO;CAGhB"}
1
+ {"version":3,"file":"InviteRecordFormCustomization.d.ts","sourceRoot":"","sources":["../../../src/form/InviteRecordFormCustomization.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAsB,WAAW,EAAE,MAAM,eAAe,CAAC;AAChE,OAAO,EAAE,uBAAuB,EAAmB,MAAM,kBAAkB,CAAC;AAC5E,OAAO,EAAoB,MAAM,EAAsC,MAAM,iBAAiB,CAAC;AAG/F;;;;;;;;GAQG;AACH,qBAAa,6BAA8B,SAAQ,uBAAuB;IACjE,KAAK,wCAAiB;IAE7B,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,kBAAkB,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE;IAK5G,cAAc,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,EAAE,kBAAkB,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,WAAW,CAAC,GAAG,CAAC;IASlG,OAAO,CAAC,UAAU;IA+BlB,OAAO,CAAC,YAAY;IAsBpB;;;;OAIG;IACH,OAAO,CAAC,cAAc;CAGvB"}
@@ -99,7 +99,7 @@ var InviteRecordFormCustomization = /** @class */ (function (_super) {
99
99
  return {
100
100
  name: 'Send invite',
101
101
  accessibility: {
102
- hidden: !!invite || !this.isAdmin(),
102
+ hidden: !!invite || !this.canManageUsers(),
103
103
  },
104
104
  style: {
105
105
  color: 'primary',
@@ -135,7 +135,7 @@ var InviteRecordFormCustomization = /** @class */ (function (_super) {
135
135
  return {
136
136
  name: 'Revoke',
137
137
  accessibility: {
138
- hidden: !invite || !this.isAdmin(),
138
+ hidden: !invite || !this.canManageUsers(),
139
139
  },
140
140
  style: {
141
141
  color: 'primary',
@@ -161,11 +161,12 @@ var InviteRecordFormCustomization = /** @class */ (function (_super) {
161
161
  };
162
162
  };
163
163
  /**
164
- * The same admin gate the standalone invite page carried, so these actions aren't offered to users
165
- * who can't perform them. `SignupService.serviceMetadata.auth` is what actually enforces it.
164
+ * The same 'users'-permission gate the service door carries, so these actions aren't offered to
165
+ * users who can't perform them. `SignupService.serviceMetadata.auth` is what actually enforces
166
+ * it; admin still passes via break-glass.
166
167
  */
167
- InviteRecordFormCustomization.prototype.isAdmin = function () {
168
- return user_1.UserAuth.hasRole('admin');
168
+ InviteRecordFormCustomization.prototype.canManageUsers = function () {
169
+ return user_1.UserAuth.hasPermission(user_1.USER_PERMISSIONS.users);
169
170
  };
170
171
  return InviteRecordFormCustomization;
171
172
  }(db_ui_1.RecordFormCustomization));
@@ -1 +1 @@
1
- {"version":3,"file":"InviteRecordFormCustomization.js","sourceRoot":"","sources":["../../../src/form/InviteRecordFormCustomization.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;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,EAAjB,CAAiB;SACzC,CAAC;IACJ,CAAC;IAED;;;;OAIG;IACK,sDAAc,GAAtB;QACE,OAAO,eAAQ,CAAC,aAAa,CAAC,uBAAgB,CAAC,KAAK,CAAC,CAAC;IACxD,CAAC;IACH,oCAAC;AAAD,CAAC,AA9ED,CAAmD,+BAAuB,GA8EzE;AA9EY,sEAA6B"}
@@ -0,0 +1,14 @@
1
+ import { Page } from '@proteinjs/ui';
2
+ /**
3
+ * The page-auth decision `AuthenticatedPageContainer` enforces — one owner, mirrored on
4
+ * `ServiceAuth` (services) and `TableAuth` (tables):
5
+ * - `public`: anyone
6
+ * - `allUsers`: any logged-in user
7
+ * - `permission`: holders of an abstract permission slug, resolved through the consumer app's
8
+ * `PermissionRolesMapping` (admin passes every permission — break-glass); takes precedence
9
+ * over `roles` when both are set
10
+ * - `roles`: holders of all listed roles
11
+ * - unspecified: admin only (default deny)
12
+ */
13
+ export declare function canViewPage(page: Page): boolean;
14
+ //# sourceMappingURL=pageAuth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageAuth.d.ts","sourceRoot":"","sources":["../../src/pageAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAGrC;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,IAAI,GAAG,OAAO,CAkB/C"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.canViewPage = void 0;
4
+ var user_1 = require("@proteinjs/user");
5
+ /**
6
+ * The page-auth decision `AuthenticatedPageContainer` enforces — one owner, mirrored on
7
+ * `ServiceAuth` (services) and `TableAuth` (tables):
8
+ * - `public`: anyone
9
+ * - `allUsers`: any logged-in user
10
+ * - `permission`: holders of an abstract permission slug, resolved through the consumer app's
11
+ * `PermissionRolesMapping` (admin passes every permission — break-glass); takes precedence
12
+ * over `roles` when both are set
13
+ * - `roles`: holders of all listed roles
14
+ * - unspecified: admin only (default deny)
15
+ */
16
+ function canViewPage(page) {
17
+ var _a, _b, _c, _d;
18
+ if ((_a = page.auth) === null || _a === void 0 ? void 0 : _a.public) {
19
+ return true;
20
+ }
21
+ if ((_b = page.auth) === null || _b === void 0 ? void 0 : _b.allUsers) {
22
+ return user_1.UserAuth.isLoggedIn();
23
+ }
24
+ if ((_c = page.auth) === null || _c === void 0 ? void 0 : _c.permission) {
25
+ return user_1.UserAuth.hasPermission(page.auth.permission);
26
+ }
27
+ if (!((_d = page.auth) === null || _d === void 0 ? void 0 : _d.roles)) {
28
+ return user_1.UserAuth.hasRole('admin');
29
+ }
30
+ return user_1.UserAuth.hasRoles(page.auth.roles);
31
+ }
32
+ exports.canViewPage = canViewPage;
33
+ //# sourceMappingURL=pageAuth.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageAuth.js","sourceRoot":"","sources":["../../src/pageAuth.ts"],"names":[],"mappings":";;;AACA,wCAA2C;AAE3C;;;;;;;;;;GAUG;AACH,SAAgB,WAAW,CAAC,IAAU;;IACpC,IAAI,MAAA,IAAI,CAAC,IAAI,0CAAE,MAAM,EAAE;QACrB,OAAO,IAAI,CAAC;KACb;IAED,IAAI,MAAA,IAAI,CAAC,IAAI,0CAAE,QAAQ,EAAE;QACvB,OAAO,eAAQ,CAAC,UAAU,EAAE,CAAC;KAC9B;IAED,IAAI,MAAA,IAAI,CAAC,IAAI,0CAAE,UAAU,EAAE;QACzB,OAAO,eAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;KACrD;IAED,IAAI,CAAC,CAAA,MAAA,IAAI,CAAC,IAAI,0CAAE,KAAK,CAAA,EAAE;QACrB,OAAO,eAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;KAClC;IAED,OAAO,eAAQ,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC5C,CAAC;AAlBD,kCAkBC"}
@@ -7,6 +7,11 @@ var setRoles = function (roles) {
7
7
  getUser: function () { return ({ email: 'someone@n3xa.io', roles: roles }); },
8
8
  };
9
9
  };
10
+ var setMapping = function (mapping) {
11
+ user_1.UserAuth.permissionRolesMapping = {
12
+ getRoles: function (permission) { return mapping[permission]; },
13
+ };
14
+ };
10
15
  var defaultFormButtons = function () { return ({
11
16
  delete: { name: 'Delete', style: {} },
12
17
  save: { name: 'Save', style: {} },
@@ -21,6 +26,7 @@ var visibleButtons = function (record) {
21
26
  describe('Invite record form customization', function () {
22
27
  afterEach(function () {
23
28
  user_1.UserAuth.userRepo = undefined;
29
+ user_1.UserAuth.permissionRolesMapping = undefined;
24
30
  });
25
31
  it('replaces raw record create/delete with send/revoke', function () {
26
32
  setRoles(['admin']);
@@ -35,13 +41,19 @@ describe('Invite record form customization', function () {
35
41
  expect(visibleButtons(existingInvite)).toContain('revoke');
36
42
  expect(visibleButtons(existingInvite)).not.toContain('send');
37
43
  });
38
- it('offers a non-admin neither action', function () {
44
+ it('offers a caller without the users permission neither action', function () {
39
45
  setRoles([]);
40
46
  expect(visibleButtons(undefined)).not.toContain('send');
41
47
  expect(visibleButtons(undefined)).not.toContain('revoke');
42
48
  expect(visibleButtons(existingInvite)).not.toContain('send');
43
49
  expect(visibleButtons(existingInvite)).not.toContain('revoke');
44
50
  });
51
+ it("offers a holder of the consumer's users-mapped role both actions in their places", function () {
52
+ setRoles(['support']);
53
+ setMapping({ users: ['support'] });
54
+ expect(visibleButtons(undefined)).toContain('send');
55
+ expect(visibleButtons(existingInvite)).toContain('revoke');
56
+ });
45
57
  it('asks only for an email when sending, and shows the whole record otherwise', function () {
46
58
  var customization = new InviteRecordFormCustomization_1.InviteRecordFormCustomization();
47
59
  expect(customization.getFieldLayout(undefined, defaultFieldLayout)).toEqual(['email']);
@@ -1 +1 @@
1
- {"version":3,"file":"InviteRecordFormCustomization.test.js","sourceRoot":"","sources":["../../test/InviteRecordFormCustomization.test.ts"],"names":[],"mappings":";;AAC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AEH,EAAE,CAAC,2EAA2E,EAAE;QAC9E,IAAM,aAAa,GAAG,IAAI,6DAA6B,EAAE,CAAC;QAC1D,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACvF,MAAM,CAAC,aAAa,CAAC,cAAc,CAAC,cAAc,EAAE,kBAAkB,CAAC,CAAC,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACvG,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=pageAuth.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageAuth.test.d.ts","sourceRoot":"","sources":["../../test/pageAuth.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ var user_1 = require("@proteinjs/user");
4
+ var pageAuth_1 = require("../src/pageAuth");
5
+ var setUser = function (roles, email) {
6
+ if (email === void 0) { email = 'user@test.local'; }
7
+ user_1.UserAuth.userRepo = {
8
+ getUser: function () { return ({ email: email, roles: roles }); },
9
+ };
10
+ };
11
+ var setMapping = function (mapping) {
12
+ user_1.UserAuth.permissionRolesMapping = {
13
+ getRoles: function (permission) { return mapping[permission]; },
14
+ };
15
+ };
16
+ var pageWith = function (auth) { return ({ name: 'test', path: 'test', component: null, auth: auth }); };
17
+ describe('canViewPage', function () {
18
+ afterEach(function () {
19
+ user_1.UserAuth.userRepo = undefined;
20
+ user_1.UserAuth.permissionRolesMapping = undefined;
21
+ });
22
+ it('public pages render for anyone; allUsers pages need a login', function () {
23
+ setUser([], 'guest');
24
+ expect((0, pageAuth_1.canViewPage)(pageWith({ public: true }))).toBe(true);
25
+ expect((0, pageAuth_1.canViewPage)(pageWith({ allUsers: true }))).toBe(false);
26
+ setUser([]);
27
+ expect((0, pageAuth_1.canViewPage)(pageWith({ allUsers: true }))).toBe(true);
28
+ });
29
+ it('permission pages render for holders of a mapped role, deny others', function () {
30
+ setMapping({ ops: ['ops'] });
31
+ setUser(['ops']);
32
+ expect((0, pageAuth_1.canViewPage)(pageWith({ permission: 'ops' }))).toBe(true);
33
+ setUser(['dev']);
34
+ expect((0, pageAuth_1.canViewPage)(pageWith({ permission: 'ops' }))).toBe(false);
35
+ });
36
+ it('admin passes any permission page (break-glass)', function () {
37
+ setUser(['admin']);
38
+ expect((0, pageAuth_1.canViewPage)(pageWith({ permission: 'ops' }))).toBe(true);
39
+ });
40
+ it('permission takes precedence over roles when both are set', function () {
41
+ setMapping({ ops: ['ops'] });
42
+ setUser(['legacy-role']);
43
+ expect((0, pageAuth_1.canViewPage)(pageWith({ permission: 'ops', roles: ['legacy-role'] }))).toBe(false);
44
+ });
45
+ it('roles pages still work; unspecified auth stays admin-only', function () {
46
+ setUser(['ops']);
47
+ expect((0, pageAuth_1.canViewPage)(pageWith({ roles: ['ops'] }))).toBe(true);
48
+ expect((0, pageAuth_1.canViewPage)(pageWith(undefined))).toBe(false);
49
+ setUser(['admin']);
50
+ expect((0, pageAuth_1.canViewPage)(pageWith(undefined))).toBe(true);
51
+ });
52
+ });
53
+ //# sourceMappingURL=pageAuth.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"pageAuth.test.js","sourceRoot":"","sources":["../../test/pageAuth.test.ts"],"names":[],"mappings":";;AACA,wCAA2C;AAC3C,4CAA8C;AAgB9C,IAAM,OAAO,GAAG,UAAC,KAAe,EAAE,KAAyB;IAAzB,sBAAA,EAAA,yBAAyB;IACxD,eAAyC,CAAC,QAAQ,GAAG;QACpD,OAAO,EAAE,cAAM,OAAA,CAAC,EAAE,KAAK,OAAA,EAAE,KAAK,OAAA,EAAE,CAAC,EAAlB,CAAkB;KAClC,CAAC;AACJ,CAAC,CAAC;AAEF,IAAM,UAAU,GAAG,UAAC,OAA2C;IAC5D,eAAyC,CAAC,sBA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,CAAC,OAAO,CAAC,CAAC,CAAC;QACnB,MAAM,CAAC,IAAA,sBAAW,EAAC,QAAQ,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACtD,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -18,23 +18,23 @@ import 'react-router-dom';
18
18
 
19
19
  /** Generate Source Graph */
20
20
 
21
- const sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"/Omit\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"forgotPasswordPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/pages/ForgotPassword.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/forgotPasswordPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/ui/Page\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"loginPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/pages/Login.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/loginPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"passwordResetPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/pages/PasswordReset.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/passwordResetPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/signupPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"signupPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/pages/Signup.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/signupPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"InviteRecordFormCustomization\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa4/packages/proteinjs/packages/user/packages/ui/src/form/InviteRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFormButtons\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFormButtons\",\"type\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"sendButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"revokeButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"isAdmin\",\"returnType\":{\"packageName\":\"\",\"name\":\"boolean\",\"filePath\":null,\"qualifiedName\":\"/boolean\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db-ui/RecordFormCustomization\"}],\"edges\":[{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/signupPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"}]}";
21
+ const sourceGraph = "{\"options\":{\"directed\":true,\"multigraph\":false,\"compound\":false},\"nodes\":[{\"v\":\"/Omit\"},{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"InviteRecordFormCustomization\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/form/InviteRecordFormCustomization.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[{\"name\":\"table\",\"type\":null,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\"}],\"methods\":[{\"name\":\"getFieldLayout\",\"returnType\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFieldLayout\",\"type\":{\"packageName\":\"\",\"name\":\"string[] | string[][]\",\"filePath\":null,\"qualifiedName\":\"/string[] | string[][]\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"getFormButtons\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}},{\"name\":\"defaultFormButtons\",\"type\":{\"packageName\":\"\",\"name\":\"FormButtons<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButtons<any>\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"sendButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"revokeButton\",\"returnType\":{\"packageName\":\"\",\"name\":\"FormButton<any>\",\"filePath\":null,\"qualifiedName\":\"/FormButton<any>\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[{\"name\":\"invite\",\"type\":{\"packageName\":\"\",\"name\":\"Invite | undefined\",\"filePath\":null,\"qualifiedName\":\"/Invite | undefined\",\"typeParameters\":null,\"directParents\":null}}]},{\"name\":\"canManageUsers\",\"returnType\":{\"packageName\":\"\",\"name\":\"boolean\",\"filePath\":null,\"qualifiedName\":\"/boolean\",\"typeParameters\":null,\"directParents\":null},\"isAsync\":false,\"isOptional\":false,\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"private\",\"parameters\":[]}],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[{\"packageName\":\"@proteinjs/db-ui\",\"name\":\"RecordFormCustomization\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/db-ui/RecordFormCustomization\",\"isAbstract\":false,\"isStatic\":false,\"visibility\":\"public\",\"properties\":[],\"methods\":[],\"typeParameters\":[],\"directParentInterfaces\":[],\"directParentClasses\":[]}],\"sourceType\":2}},{\"v\":\"@proteinjs/db-ui/RecordFormCustomization\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"forgotPasswordPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/pages/ForgotPassword.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/forgotPasswordPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/ui/Page\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"loginPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/pages/Login.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/loginPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"passwordResetPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/pages/PasswordReset.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/passwordResetPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}},{\"v\":\"@proteinjs/user-ui/signupPage\",\"value\":{\"packageName\":\"@proteinjs/user-ui\",\"name\":\"signupPage\",\"filePath\":\"/Users/brentbahry/repos/farm/n3xa2/packages/proteinjs/packages/user/packages/ui/src/pages/Signup.tsx\",\"qualifiedName\":\"@proteinjs/user-ui/signupPage\",\"type\":{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":[{\"packageName\":\"@proteinjs/ui\",\"name\":\"Page\",\"filePath\":null,\"qualifiedName\":\"@proteinjs/ui/Page\",\"typeParameters\":[],\"directParents\":null}]},\"isExported\":true,\"isConst\":true,\"sourceType\":0}}],\"edges\":[{\"v\":\"@proteinjs/user-ui/InviteRecordFormCustomization\",\"w\":\"@proteinjs/db-ui/RecordFormCustomization\",\"value\":\"extends class\"},{\"v\":\"@proteinjs/user-ui/forgotPasswordPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/loginPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/passwordResetPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"},{\"v\":\"@proteinjs/user-ui/signupPage\",\"w\":\"@proteinjs/ui/Page\",\"value\":\"has type\"}]}";
22
22
 
23
23
 
24
24
  /** Generate Source Links */
25
25
 
26
+ import { InviteRecordFormCustomization } from '../src/form/InviteRecordFormCustomization';
26
27
  import { forgotPasswordPage } from '../src/pages/ForgotPassword';
27
28
  import { loginPage } from '../src/pages/Login';
28
29
  import { passwordResetPage } from '../src/pages/PasswordReset';
29
30
  import { signupPage } from '../src/pages/Signup';
30
- import { InviteRecordFormCustomization } from '../src/form/InviteRecordFormCustomization';
31
31
 
32
32
  const sourceLinks = {
33
+ '@proteinjs/user-ui/InviteRecordFormCustomization': InviteRecordFormCustomization,
33
34
  '@proteinjs/user-ui/forgotPasswordPage': forgotPasswordPage,
34
35
  '@proteinjs/user-ui/loginPage': loginPage,
35
36
  '@proteinjs/user-ui/passwordResetPage': passwordResetPage,
36
37
  '@proteinjs/user-ui/signupPage': signupPage,
37
- '@proteinjs/user-ui/InviteRecordFormCustomization': InviteRecordFormCustomization,
38
38
  };
39
39
 
40
40
 
package/index.ts CHANGED
@@ -1 +1,2 @@
1
1
  export * from './src/AuthenticatedPageContainer';
2
+ export * from './src/pageAuth';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@proteinjs/user-ui",
3
- "version": "1.3.1",
3
+ "version": "1.4.0",
4
4
  "description": "User ui components",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -24,12 +24,12 @@
24
24
  "dependencies": {
25
25
  "@mui/icons-material": "5.14.11",
26
26
  "@mui/material": "5.14.11",
27
- "@proteinjs/db": "^1.27.0",
28
- "@proteinjs/db-ui": "^1.6.1",
27
+ "@proteinjs/db": "^1.28.0",
28
+ "@proteinjs/db-ui": "^1.7.0",
29
29
  "@proteinjs/reflection": "^1.1.12",
30
30
  "@proteinjs/server-api": "^3.0.10",
31
- "@proteinjs/ui": "^4.4.0",
32
- "@proteinjs/user": "^1.6.1",
31
+ "@proteinjs/ui": "^4.5.0",
32
+ "@proteinjs/user": "^1.7.0",
33
33
  "@proteinjs/util": "^1.6.1",
34
34
  "moment": "2.29.4",
35
35
  "react": "18.2.0",
@@ -1,6 +1,7 @@
1
1
  import React from 'react';
2
- import { Page, PageContainer, PageContainerProps } from '@proteinjs/ui';
2
+ import { PageContainer, PageContainerProps } from '@proteinjs/ui';
3
3
  import { routes, guestUser, UserAuth, UserRepo, uiRoutes } from '@proteinjs/user';
4
+ import { canViewPage } from './pageAuth';
4
5
 
5
6
  export type AuthenticatedPageContainerProps = Omit<PageContainerProps, 'auth'>;
6
7
 
@@ -12,21 +13,7 @@ export function AuthenticatedPageContainer(props: AuthenticatedPageContainerProp
12
13
  <PageContainer
13
14
  auth={{
14
15
  isLoggedIn,
15
- canViewPage: (page: Page) => {
16
- if (page.auth?.public) {
17
- return true;
18
- }
19
-
20
- if (page.auth?.allUsers) {
21
- return UserAuth.isLoggedIn();
22
- }
23
-
24
- if (!page.auth?.roles) {
25
- return UserAuth.hasRole('admin');
26
- }
27
-
28
- return UserAuth.hasRoles(page.auth?.roles);
29
- },
16
+ canViewPage,
30
17
  login: uiRoutes.auth.login,
31
18
  logout: async () => {
32
19
  const response = await fetch(routes.logout.path, {
@@ -1,6 +1,6 @@
1
1
  import { Fields, FormButton, FormButtons } from '@proteinjs/ui';
2
2
  import { RecordFormCustomization, recordTableLink } from '@proteinjs/db-ui';
3
- import { getSignupService, Invite, tables, UserAuth } from '@proteinjs/user';
3
+ import { getSignupService, Invite, tables, UserAuth, USER_PERMISSIONS } from '@proteinjs/user';
4
4
  import { emailRegex } from '@proteinjs/util';
5
5
 
6
6
  /**
@@ -33,7 +33,7 @@ export class InviteRecordFormCustomization extends RecordFormCustomization {
33
33
  return {
34
34
  name: 'Send invite',
35
35
  accessibility: {
36
- hidden: !!invite || !this.isAdmin(),
36
+ hidden: !!invite || !this.canManageUsers(),
37
37
  },
38
38
  style: {
39
39
  color: 'primary',
@@ -64,7 +64,7 @@ export class InviteRecordFormCustomization extends RecordFormCustomization {
64
64
  return {
65
65
  name: 'Revoke',
66
66
  accessibility: {
67
- hidden: !invite || !this.isAdmin(),
67
+ hidden: !invite || !this.canManageUsers(),
68
68
  },
69
69
  style: {
70
70
  color: 'primary',
@@ -83,10 +83,11 @@ export class InviteRecordFormCustomization extends RecordFormCustomization {
83
83
  }
84
84
 
85
85
  /**
86
- * The same admin gate the standalone invite page carried, so these actions aren't offered to users
87
- * who can't perform them. `SignupService.serviceMetadata.auth` is what actually enforces it.
86
+ * The same 'users'-permission gate the service door carries, so these actions aren't offered to
87
+ * users who can't perform them. `SignupService.serviceMetadata.auth` is what actually enforces
88
+ * it; admin still passes via break-glass.
88
89
  */
89
- private isAdmin(): boolean {
90
- return UserAuth.hasRole('admin');
90
+ private canManageUsers(): boolean {
91
+ return UserAuth.hasPermission(USER_PERMISSIONS.users);
91
92
  }
92
93
  }
@@ -0,0 +1,33 @@
1
+ import { Page } from '@proteinjs/ui';
2
+ import { UserAuth } from '@proteinjs/user';
3
+
4
+ /**
5
+ * The page-auth decision `AuthenticatedPageContainer` enforces — one owner, mirrored on
6
+ * `ServiceAuth` (services) and `TableAuth` (tables):
7
+ * - `public`: anyone
8
+ * - `allUsers`: any logged-in user
9
+ * - `permission`: holders of an abstract permission slug, resolved through the consumer app's
10
+ * `PermissionRolesMapping` (admin passes every permission — break-glass); takes precedence
11
+ * over `roles` when both are set
12
+ * - `roles`: holders of all listed roles
13
+ * - unspecified: admin only (default deny)
14
+ */
15
+ export function canViewPage(page: Page): boolean {
16
+ if (page.auth?.public) {
17
+ return true;
18
+ }
19
+
20
+ if (page.auth?.allUsers) {
21
+ return UserAuth.isLoggedIn();
22
+ }
23
+
24
+ if (page.auth?.permission) {
25
+ return UserAuth.hasPermission(page.auth.permission);
26
+ }
27
+
28
+ if (!page.auth?.roles) {
29
+ return UserAuth.hasRole('admin');
30
+ }
31
+
32
+ return UserAuth.hasRoles(page.auth.roles);
33
+ }
@@ -4,14 +4,18 @@ import { InviteRecordFormCustomization } from '../src/form/InviteRecordFormCusto
4
4
 
5
5
  /**
6
6
  * Invites are managed from the invite record surface: the new-record form sends one, an existing
7
- * invite row revokes one. Both actions are admin-only — `SignupService.serviceMetadata.auth` is the
8
- * enforcement (covered in @proteinjs/user-server), and these assertions cover the affordances, so a
9
- * non-admin is never offered a button that can only fail.
7
+ * invite row revokes one. Both actions ride the 'users' permission (admin passes via
8
+ * break-glass) — `SignupService.serviceMetadata.auth` is the enforcement (covered in
9
+ * @proteinjs/user-server), and these assertions cover the affordances, so a caller who can't
10
+ * perform them is never offered a button that can only fail.
10
11
  *
11
12
  * `UserAuth` reads from a static repo; stubbing it directly is how the server-side authz tests do it.
12
13
  */
13
14
 
14
- type UserAuthInternals = { userRepo?: { getUser: () => { email: string; roles: string[] } } };
15
+ type UserAuthInternals = {
16
+ userRepo?: { getUser: () => { email: string; roles: string[] } };
17
+ permissionRolesMapping?: { getRoles: (permission: string) => string[] | undefined };
18
+ };
15
19
 
16
20
  const setRoles = (roles: string[]) => {
17
21
  (UserAuth as unknown as UserAuthInternals).userRepo = {
@@ -19,6 +23,12 @@ const setRoles = (roles: string[]) => {
19
23
  };
20
24
  };
21
25
 
26
+ const setMapping = (mapping: { [permission: string]: string[] }) => {
27
+ (UserAuth as unknown as UserAuthInternals).permissionRolesMapping = {
28
+ getRoles: (permission: string) => mapping[permission],
29
+ };
30
+ };
31
+
22
32
  const defaultFormButtons = (): FormButtons<any> => ({
23
33
  delete: { name: 'Delete', style: {} },
24
34
  save: { name: 'Save', style: {} },
@@ -36,6 +46,7 @@ const visibleButtons = (record: Invite | undefined) => {
36
46
  describe('Invite record form customization', () => {
37
47
  afterEach(() => {
38
48
  (UserAuth as unknown as UserAuthInternals).userRepo = undefined;
49
+ (UserAuth as unknown as UserAuthInternals).permissionRolesMapping = undefined;
39
50
  });
40
51
 
41
52
  it('replaces raw record create/delete with send/revoke', () => {
@@ -53,7 +64,7 @@ describe('Invite record form customization', () => {
53
64
  expect(visibleButtons(existingInvite)).not.toContain('send');
54
65
  });
55
66
 
56
- it('offers a non-admin neither action', () => {
67
+ it('offers a caller without the users permission neither action', () => {
57
68
  setRoles([]);
58
69
  expect(visibleButtons(undefined)).not.toContain('send');
59
70
  expect(visibleButtons(undefined)).not.toContain('revoke');
@@ -61,6 +72,13 @@ describe('Invite record form customization', () => {
61
72
  expect(visibleButtons(existingInvite)).not.toContain('revoke');
62
73
  });
63
74
 
75
+ it(`offers a holder of the consumer's users-mapped role both actions in their places`, () => {
76
+ setRoles(['support']);
77
+ setMapping({ users: ['support'] });
78
+ expect(visibleButtons(undefined)).toContain('send');
79
+ expect(visibleButtons(existingInvite)).toContain('revoke');
80
+ });
81
+
64
82
  it('asks only for an email when sending, and shows the whole record otherwise', () => {
65
83
  const customization = new InviteRecordFormCustomization();
66
84
  expect(customization.getFieldLayout(undefined, defaultFieldLayout)).toEqual(['email']);
@@ -0,0 +1,76 @@
1
+ import { Page } from '@proteinjs/ui';
2
+ import { UserAuth } from '@proteinjs/user';
3
+ import { canViewPage } from '../src/pageAuth';
4
+
5
+ /**
6
+ * The page-auth decision `AuthenticatedPageContainer` enforces, including the permission door:
7
+ * pages declare `{ permission: '<slug>' }` and the slug resolves to consumer roles through
8
+ * `UserAuth.hasPermission` (admin passes via break-glass). The default stays admin-when-
9
+ * unspecified.
10
+ *
11
+ * `UserAuth` reads from a static repo; tests stub it directly per identity — no server needed.
12
+ */
13
+
14
+ type UserAuthInternals = {
15
+ userRepo?: { getUser: () => { email: string; roles: string[] } };
16
+ permissionRolesMapping?: { getRoles: (permission: string) => string[] | undefined };
17
+ };
18
+
19
+ const setUser = (roles: string[], email = 'user@test.local') => {
20
+ (UserAuth as unknown as UserAuthInternals).userRepo = {
21
+ getUser: () => ({ email, roles }),
22
+ };
23
+ };
24
+
25
+ const setMapping = (mapping: { [permission: string]: string[] }) => {
26
+ (UserAuth as unknown as UserAuthInternals).permissionRolesMapping = {
27
+ getRoles: (permission: string) => mapping[permission],
28
+ };
29
+ };
30
+
31
+ const pageWith = (auth: Page['auth']): Page => ({ name: 'test', path: 'test', component: null as any, auth });
32
+
33
+ describe('canViewPage', () => {
34
+ afterEach(() => {
35
+ (UserAuth as unknown as UserAuthInternals).userRepo = undefined;
36
+ (UserAuth as unknown as UserAuthInternals).permissionRolesMapping = undefined;
37
+ });
38
+
39
+ it('public pages render for anyone; allUsers pages need a login', () => {
40
+ setUser([], 'guest');
41
+ expect(canViewPage(pageWith({ public: true }))).toBe(true);
42
+ expect(canViewPage(pageWith({ allUsers: true }))).toBe(false);
43
+
44
+ setUser([]);
45
+ expect(canViewPage(pageWith({ allUsers: true }))).toBe(true);
46
+ });
47
+
48
+ it('permission pages render for holders of a mapped role, deny others', () => {
49
+ setMapping({ ops: ['ops'] });
50
+ setUser(['ops']);
51
+ expect(canViewPage(pageWith({ permission: 'ops' }))).toBe(true);
52
+
53
+ setUser(['dev']);
54
+ expect(canViewPage(pageWith({ permission: 'ops' }))).toBe(false);
55
+ });
56
+
57
+ it('admin passes any permission page (break-glass)', () => {
58
+ setUser(['admin']);
59
+ expect(canViewPage(pageWith({ permission: 'ops' }))).toBe(true);
60
+ });
61
+
62
+ it('permission takes precedence over roles when both are set', () => {
63
+ setMapping({ ops: ['ops'] });
64
+ setUser(['legacy-role']);
65
+ expect(canViewPage(pageWith({ permission: 'ops', roles: ['legacy-role'] }))).toBe(false);
66
+ });
67
+
68
+ it('roles pages still work; unspecified auth stays admin-only', () => {
69
+ setUser(['ops']);
70
+ expect(canViewPage(pageWith({ roles: ['ops'] }))).toBe(true);
71
+ expect(canViewPage(pageWith(undefined))).toBe(false);
72
+
73
+ setUser(['admin']);
74
+ expect(canViewPage(pageWith(undefined))).toBe(true);
75
+ });
76
+ });