chyz 2.0.1-rc.3 → 2.0.1-rc.36

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.
Files changed (229) hide show
  1. package/BaseChyz.ts +623 -0
  2. package/README.md +518 -518
  3. package/base/ActionFilter.ts +88 -0
  4. package/base/BadRequestHttpException.ts +14 -0
  5. package/base/{BaseError.js → BaseError.ts} +26 -18
  6. package/base/Behavior.ts +6 -0
  7. package/base/CBaseObject.ts +17 -0
  8. package/base/CEvents.ts +24 -0
  9. package/base/{CRequest.js → CRequest.ts} +6 -2
  10. package/base/CWebController.ts +90 -0
  11. package/base/Component.ts +66 -0
  12. package/{model/RouteDefinition.js → base/Configurable.ts} +4 -2
  13. package/base/DataErrorDbException.ts +16 -0
  14. package/base/DbConnection.ts +55 -0
  15. package/base/ForbiddenHttpException.ts +15 -0
  16. package/base/InvalidArgumentException.ts +16 -0
  17. package/base/InvalidConfigException.ts +16 -0
  18. package/base/{Logs.js → Logs.ts} +41 -24
  19. package/base/{Model.js → Model.ts} +225 -158
  20. package/base/{ModelManager.js → ModelManager.ts} +7 -7
  21. package/base/NotFoundHttpException.ts +14 -0
  22. package/base/RestClient.ts +26 -0
  23. package/base/UnauthorizedHttpException.ts +17 -0
  24. package/base/ValidationHttpException.ts +14 -0
  25. package/base/db/Exception.ts +14 -0
  26. package/base/index.ts +19 -0
  27. package/decorator/Middleware.ts +9 -0
  28. package/decorator/{controller.js → controller.ts} +7 -9
  29. package/decorator/{delete.js → delete.ts} +9 -9
  30. package/decorator/enums/ControllerDecoratorParams.ts +5 -0
  31. package/decorator/{get.js → get.ts} +11 -10
  32. package/decorator/index.ts +5 -0
  33. package/decorator/{post.js → post.ts} +10 -10
  34. package/decorator/{put.js → put.ts} +9 -9
  35. package/filters/AccessControl.ts +74 -0
  36. package/filters/AccessRule.ts +182 -0
  37. package/filters/auth/{AuthInterface.d.ts → AuthInterface.ts} +15 -7
  38. package/filters/auth/AuthMethod.ts +100 -0
  39. package/filters/auth/HttpBasicAuth.ts +79 -0
  40. package/filters/auth/HttpBearerAuth.ts +34 -0
  41. package/filters/auth/HttpHeaderAuth.ts +61 -0
  42. package/filters/auth/JwtHttpBearerAuth.ts +83 -0
  43. package/filters/auth/KeyCloakHttpBearerAuth.ts +114 -0
  44. package/filters/auth/index.ts +4 -0
  45. package/filters/index.ts +2 -0
  46. package/index.ts +80 -0
  47. package/log/config/log4js.json +55 -55
  48. package/model/RouteDefinition.ts +18 -0
  49. package/package.json +63 -61
  50. package/rbac/AuthAssignment.ts +50 -0
  51. package/rbac/{AuthItem.js → AuthItem.ts} +22 -16
  52. package/rbac/{AuthItemChild.js → AuthItemChild.ts} +21 -14
  53. package/rbac/AuthManager.ts +399 -0
  54. package/rbac/index.ts +12 -0
  55. package/{web/IdentityInterface.js → requiments/Glob.ts} +3 -2
  56. package/requiments/{ReflectUtil.js → ReflectUtil.ts} +6 -4
  57. package/requiments/{Utils.js → Utils.ts} +40 -34
  58. package/validators/BooleanValidator.ts +0 -0
  59. package/validators/CompareValidator.ts +0 -0
  60. package/validators/DateValidator.ts +0 -0
  61. package/validators/EmailValidator.ts +0 -0
  62. package/validators/Validator.ts +27 -0
  63. package/web/{IdentityInterface.d.ts → IdentityInterface.ts} +15 -2
  64. package/web/WebUser.ts +187 -0
  65. package/BaseChyz.d.ts +0 -74
  66. package/BaseChyz.d.ts.map +0 -1
  67. package/BaseChyz.js +0 -569
  68. package/base/ActionFilter.d.ts +0 -33
  69. package/base/ActionFilter.d.ts.map +0 -1
  70. package/base/ActionFilter.js +0 -90
  71. package/base/BadRequestHttpException.d.ts +0 -6
  72. package/base/BadRequestHttpException.d.ts.map +0 -1
  73. package/base/BadRequestHttpException.js +0 -17
  74. package/base/BaseError.d.ts +0 -44
  75. package/base/BaseError.d.ts.map +0 -1
  76. package/base/Behavior.d.ts +0 -4
  77. package/base/Behavior.d.ts.map +0 -1
  78. package/base/Behavior.js +0 -7
  79. package/base/CBaseObject.d.ts +0 -5
  80. package/base/CBaseObject.d.ts.map +0 -1
  81. package/base/CBaseObject.js +0 -16
  82. package/base/CEvents.d.ts +0 -13
  83. package/base/CEvents.d.ts.map +0 -1
  84. package/base/CEvents.js +0 -24
  85. package/base/CRequest.d.ts +0 -2
  86. package/base/CRequest.d.ts.map +0 -1
  87. package/base/CWebController.d.ts +0 -44
  88. package/base/CWebController.d.ts.map +0 -1
  89. package/base/CWebController.js +0 -81
  90. package/base/Component.d.ts +0 -21
  91. package/base/Component.d.ts.map +0 -1
  92. package/base/Component.js +0 -57
  93. package/base/Configurable.d.ts +0 -3
  94. package/base/Configurable.d.ts.map +0 -1
  95. package/base/Configurable.js +0 -8
  96. package/base/DataErrorDbException.d.ts +0 -6
  97. package/base/DataErrorDbException.d.ts.map +0 -1
  98. package/base/DataErrorDbException.js +0 -17
  99. package/base/DbConnection.d.ts +0 -13
  100. package/base/DbConnection.d.ts.map +0 -1
  101. package/base/DbConnection.js +0 -53
  102. package/base/ForbiddenHttpException.d.ts +0 -5
  103. package/base/ForbiddenHttpException.d.ts.map +0 -1
  104. package/base/ForbiddenHttpException.js +0 -16
  105. package/base/InvalidArgumentException.d.ts +0 -6
  106. package/base/InvalidArgumentException.d.ts.map +0 -1
  107. package/base/InvalidArgumentException.js +0 -17
  108. package/base/InvalidConfigException.d.ts +0 -6
  109. package/base/InvalidConfigException.d.ts.map +0 -1
  110. package/base/InvalidConfigException.js +0 -17
  111. package/base/Logs.d.ts +0 -22
  112. package/base/Logs.d.ts.map +0 -1
  113. package/base/Model.d.ts +0 -302
  114. package/base/Model.d.ts.map +0 -1
  115. package/base/ModelManager.d.ts +0 -2
  116. package/base/ModelManager.d.ts.map +0 -1
  117. package/base/NotFoundHttpException.d.ts +0 -6
  118. package/base/NotFoundHttpException.d.ts.map +0 -1
  119. package/base/NotFoundHttpException.js +0 -17
  120. package/base/RestClient.d.ts +0 -7
  121. package/base/RestClient.d.ts.map +0 -1
  122. package/base/RestClient.js +0 -25
  123. package/base/UnauthorizedHttpException.d.ts +0 -6
  124. package/base/UnauthorizedHttpException.d.ts.map +0 -1
  125. package/base/UnauthorizedHttpException.js +0 -17
  126. package/base/ValidationHttpException.d.ts +0 -6
  127. package/base/ValidationHttpException.d.ts.map +0 -1
  128. package/base/ValidationHttpException.js +0 -17
  129. package/base/db/Exception.d.ts +0 -7
  130. package/base/db/Exception.d.ts.map +0 -1
  131. package/base/db/Exception.js +0 -15
  132. package/base/index.d.ts +0 -20
  133. package/base/index.d.ts.map +0 -1
  134. package/base/index.js +0 -41
  135. package/decorator/Middleware.d.ts +0 -4
  136. package/decorator/Middleware.d.ts.map +0 -1
  137. package/decorator/Middleware.js +0 -11
  138. package/decorator/controller.d.ts +0 -3
  139. package/decorator/controller.d.ts.map +0 -1
  140. package/decorator/delete.d.ts +0 -3
  141. package/decorator/delete.d.ts.map +0 -1
  142. package/decorator/enums/ControllerDecoratorParams.d.ts +0 -6
  143. package/decorator/enums/ControllerDecoratorParams.d.ts.map +0 -1
  144. package/decorator/enums/ControllerDecoratorParams.js +0 -9
  145. package/decorator/get.d.ts +0 -3
  146. package/decorator/get.d.ts.map +0 -1
  147. package/decorator/index.d.ts +0 -6
  148. package/decorator/index.d.ts.map +0 -1
  149. package/decorator/index.js +0 -13
  150. package/decorator/post.d.ts +0 -3
  151. package/decorator/post.d.ts.map +0 -1
  152. package/decorator/put.d.ts +0 -3
  153. package/decorator/put.d.ts.map +0 -1
  154. package/filters/AccessControl.d.ts +0 -13
  155. package/filters/AccessControl.d.ts.map +0 -1
  156. package/filters/AccessControl.js +0 -83
  157. package/filters/AccessRule.d.ts +0 -83
  158. package/filters/AccessRule.d.ts.map +0 -1
  159. package/filters/AccessRule.js +0 -136
  160. package/filters/auth/AuthInterface.d.ts.map +0 -1
  161. package/filters/auth/AuthInterface.js +0 -2
  162. package/filters/auth/AuthMethod.d.ts +0 -38
  163. package/filters/auth/AuthMethod.d.ts.map +0 -1
  164. package/filters/auth/AuthMethod.js +0 -82
  165. package/filters/auth/HttpBasicAuth.d.ts +0 -24
  166. package/filters/auth/HttpBasicAuth.d.ts.map +0 -1
  167. package/filters/auth/HttpBasicAuth.js +0 -78
  168. package/filters/auth/HttpBearerAuth.d.ts +0 -18
  169. package/filters/auth/HttpBearerAuth.d.ts.map +0 -1
  170. package/filters/auth/HttpBearerAuth.js +0 -33
  171. package/filters/auth/HttpHeaderAuth.d.ts +0 -19
  172. package/filters/auth/HttpHeaderAuth.d.ts.map +0 -1
  173. package/filters/auth/HttpHeaderAuth.js +0 -64
  174. package/filters/auth/JwtHttpBearerAuth.d.ts +0 -21
  175. package/filters/auth/JwtHttpBearerAuth.d.ts.map +0 -1
  176. package/filters/auth/JwtHttpBearerAuth.js +0 -87
  177. package/filters/auth/KeyCloakHttpBearerAuth.d.ts +0 -23
  178. package/filters/auth/KeyCloakHttpBearerAuth.d.ts.map +0 -1
  179. package/filters/auth/KeyCloakHttpBearerAuth.js +0 -116
  180. package/filters/auth/index.d.ts +0 -5
  181. package/filters/auth/index.d.ts.map +0 -1
  182. package/filters/auth/index.js +0 -11
  183. package/filters/index.d.ts +0 -3
  184. package/filters/index.d.ts.map +0 -1
  185. package/filters/index.js +0 -7
  186. package/index.d.ts +0 -26
  187. package/index.d.ts.map +0 -1
  188. package/index.js +0 -72
  189. package/model/RouteDefinition.d.ts +0 -7
  190. package/model/RouteDefinition.d.ts.map +0 -1
  191. package/rbac/AuthAssignment.d.ts +0 -19
  192. package/rbac/AuthAssignment.d.ts.map +0 -1
  193. package/rbac/AuthAssignment.js +0 -44
  194. package/rbac/AuthItem.d.ts +0 -27
  195. package/rbac/AuthItem.d.ts.map +0 -1
  196. package/rbac/AuthItemChild.d.ts +0 -19
  197. package/rbac/AuthItemChild.d.ts.map +0 -1
  198. package/rbac/AuthManager.d.ts +0 -112
  199. package/rbac/AuthManager.d.ts.map +0 -1
  200. package/rbac/AuthManager.js +0 -356
  201. package/rbac/index.d.ts +0 -5
  202. package/rbac/index.d.ts.map +0 -1
  203. package/rbac/index.js +0 -28
  204. package/requiments/Glob.d.ts +0 -3
  205. package/requiments/Glob.d.ts.map +0 -1
  206. package/requiments/Glob.js +0 -10
  207. package/requiments/ReflectUtil.d.ts +0 -1
  208. package/requiments/ReflectUtil.d.ts.map +0 -1
  209. package/requiments/Utils.d.ts +0 -2
  210. package/requiments/Utils.d.ts.map +0 -1
  211. package/validators/BooleanValidator.d.ts +0 -1
  212. package/validators/BooleanValidator.d.ts.map +0 -1
  213. package/validators/BooleanValidator.js +0 -1
  214. package/validators/CompareValidator.d.ts +0 -1
  215. package/validators/CompareValidator.d.ts.map +0 -1
  216. package/validators/CompareValidator.js +0 -1
  217. package/validators/DateValidator.d.ts +0 -1
  218. package/validators/DateValidator.d.ts.map +0 -1
  219. package/validators/DateValidator.js +0 -1
  220. package/validators/EmailValidator.d.ts +0 -1
  221. package/validators/EmailValidator.d.ts.map +0 -1
  222. package/validators/EmailValidator.js +0 -1
  223. package/validators/Validator.d.ts +0 -18
  224. package/validators/Validator.d.ts.map +0 -1
  225. package/validators/Validator.js +0 -27
  226. package/web/IdentityInterface.d.ts.map +0 -1
  227. package/web/WebUser.d.ts +0 -72
  228. package/web/WebUser.d.ts.map +0 -1
  229. package/web/WebUser.js +0 -165
package/web/WebUser.d.ts DELETED
@@ -1,72 +0,0 @@
1
- import { Component } from "../base/Component";
2
- import { IdentityInterface } from "./IdentityInterface";
3
- import { AuthManager } from "../rbac/AuthManager";
4
- export declare class WebUser extends Component {
5
- /**
6
- * @var string the class name of the [[identity]] object.
7
- */
8
- identityClass: any;
9
- private _identity;
10
- /**
11
- * @var CheckAccessInterface|string|array The access checker object to use for checking access or the application
12
- * component ID of the access checker.
13
- * If not set the application auth manager will be used.
14
- * @since 2.0.9
15
- */
16
- accessChecker: any;
17
- get identity(): any;
18
- set identity(value: any);
19
- init(): void;
20
- getIsGuest(): boolean;
21
- getIdentity(autoRenew?: boolean): any;
22
- loginRequired(): void;
23
- /**
24
- * Regenerates CSRF token
25
- *
26
- * @since 2.0.14.2
27
- */
28
- protected regenerateCsrfToken(): void;
29
- /**
30
- * Logs in a user by the given access token.
31
- * @param token
32
- * @param type
33
- */
34
- loginByAccessToken(token: any, type?: any): Promise<any>;
35
- login(identity: IdentityInterface, duration?: number): boolean;
36
- beforeLogin(identity: any, cookieBased: boolean, duration: number): boolean;
37
- afterLogin(): void;
38
- getId(): any;
39
- /**
40
- * Checks if the user can perform the operation as specified by the given permission.
41
- *
42
- * Note that you must configure "authManager" application component in order to use this method.
43
- * Otherwise it will always return false.
44
- *
45
- * @param string $permissionName the name of the permission (e.g. "edit post") that needs access check.
46
- * @param array $params name-value pairs that would be passed to the rules associated
47
- * with the roles and permissions assigned to the user.
48
- * @param bool $allowCaching whether to allow caching the result of access check.
49
- * When this parameter is true (default), if the access check of an operation was performed
50
- * before, its result will be directly returned when calling this method to check the same
51
- * operation. If this parameter is false, this method will always call
52
- * [[\yii\rbac\CheckAccessInterface::checkAccess()]] to obtain the up-to-date access result. Note that this
53
- * caching is effective only within the same request and only works when `$params = []`.
54
- * @return bool whether the user can perform the operation as specified by the given permission.
55
- */
56
- can(permissionName: string, params?: never[], allowCaching?: boolean): Promise<boolean>;
57
- /**
58
- * Returns auth manager associated with the user component.
59
- *
60
- * By default this is the `authManager` application component.
61
- * You may override this method to return a different auth manager instance if needed.
62
- * @return \yii\rbac\ManagerInterface
63
- * @since 2.0.6
64
- */
65
- protected getAuthManager(): AuthManager;
66
- /**
67
- * Returns the access checker used for checking access.
68
- * @return CheckAccessInterface
69
- */
70
- protected getAccessChecker(): AuthManager;
71
- }
72
- //# sourceMappingURL=WebUser.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"WebUser.d.ts","sourceRoot":"","sources":["../../src/web/WebUser.ts"],"names":[],"mappings":"AAOA,OAAO,EAAC,SAAS,EAAC,MAAM,mBAAmB,CAAC;AAG5C,OAAO,EAAC,iBAAiB,EAAC,MAAM,qBAAqB,CAAC;AAEtD,OAAO,EAAC,WAAW,EAAC,MAAM,qBAAqB,CAAC;AAEhD,qBAAa,OAAQ,SAAQ,SAAS;IAElC;;OAEG;IACI,aAAa,EAAE,GAAG,CAAC;IAC1B,OAAO,CAAC,SAAS,CAAM;IACvB;;;;;OAKG;IACI,aAAa,EAAE,GAAG,CAAQ;IAGjC,IAAI,QAAQ,QAEX;IAED,IAAI,QAAQ,CAAC,KAAK,KAAA,EAEjB;IAEM,IAAI;IAYJ,UAAU;IAIV,WAAW,CAAC,SAAS,UAAO;IAI5B,aAAa;IAMpB;;;;OAIG;IACH,SAAS,CAAC,mBAAmB;IAI7B;;;;OAIG;IACU,kBAAkB,CAAC,KAAK,EAAE,GAAG,EAAE,IAAI,GAAE,GAAU;IAcrD,KAAK,CAAC,QAAQ,EAAE,iBAAiB,EAAE,QAAQ,SAAI,GAAG,OAAO;IAQzD,WAAW,CAAC,QAAQ,EAAE,GAAG,EAAE,WAAW,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM;IAKjE,UAAU;IAIV,KAAK;IAKZ;;;;;;;;;;;;;;;;OAgBG;IAiBU,GAAG,CAAC,cAAc,EAAE,MAAM,EAAE,MAAM,UAAK,EAAE,YAAY,UAAO;IAkBzE;;;;;;;OAOG;IACH,SAAS,CAAC,cAAc,IAAI,WAAW;IAIvC;;;OAGG;IACH,SAAS,CAAC,gBAAgB,IAAG,WAAW;CAK3C"}
package/web/WebUser.js DELETED
@@ -1,165 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- var __importDefault = (this && this.__importDefault) || function (mod) {
12
- return (mod && mod.__esModule) ? mod : { "default": mod };
13
- };
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.WebUser = void 0;
16
- /*
17
- * Copyright (c) 2021. Chy Bilgisayar Bilisim
18
- * Author: Cihan Ozturk
19
- * E-mail: cihan@chy.com.tr
20
- * Github:https://github.com/cihan53/
21
- */
22
- const BaseChyz_1 = __importDefault(require("../BaseChyz"));
23
- const Component_1 = require("../base/Component");
24
- const ForbiddenHttpException_1 = require("../base/ForbiddenHttpException");
25
- const InvalidConfigException_1 = require("../base/InvalidConfigException");
26
- const Utils_1 = require("../requiments/Utils");
27
- class WebUser extends Component_1.Component {
28
- constructor() {
29
- super(...arguments);
30
- /**
31
- * @var CheckAccessInterface|string|array The access checker object to use for checking access or the application
32
- * component ID of the access checker.
33
- * If not set the application auth manager will be used.
34
- * @since 2.0.9
35
- */
36
- this.accessChecker = null;
37
- }
38
- get identity() {
39
- return this._identity;
40
- }
41
- set identity(value) {
42
- this._identity = value;
43
- }
44
- init() {
45
- super.init();
46
- if (this.identityClass === null) {
47
- throw new InvalidConfigException_1.InvalidConfigException('User::identityClass must be set.');
48
- }
49
- this.identityClass = new this.identityClass();
50
- }
51
- getIsGuest() {
52
- return this.getIdentity() === null;
53
- }
54
- getIdentity(autoRenew = true) {
55
- return this._identity;
56
- }
57
- loginRequired() {
58
- throw new ForbiddenHttpException_1.ForbiddenHttpException(BaseChyz_1.default.t('Login Required'));
59
- }
60
- /**
61
- * Regenerates CSRF token
62
- *
63
- * @since 2.0.14.2
64
- */
65
- regenerateCsrfToken() {
66
- }
67
- /**
68
- * Logs in a user by the given access token.
69
- * @param token
70
- * @param type
71
- */
72
- loginByAccessToken(token, type = null) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- let $class = this.identityClass;
75
- if ($class.findIdentityByAccessToken) {
76
- this.identity = yield $class.findIdentityByAccessToken(token, type);
77
- if (this.identity && this.login(this.identity)) {
78
- return this.identity;
79
- }
80
- }
81
- else {
82
- BaseChyz_1.default.error("WebUser::findIdentityByAccessToken undefined");
83
- }
84
- return null;
85
- });
86
- }
87
- login(identity, duration = 0) {
88
- if (this.beforeLogin(identity, false, duration)) {
89
- }
90
- return !this.getIsGuest();
91
- }
92
- beforeLogin(identity, cookieBased, duration) {
93
- return true;
94
- }
95
- afterLogin() {
96
- }
97
- getId() {
98
- let identity = this.getIdentity();
99
- return identity !== null ? identity.id : null;
100
- }
101
- /**
102
- * Checks if the user can perform the operation as specified by the given permission.
103
- *
104
- * Note that you must configure "authManager" application component in order to use this method.
105
- * Otherwise it will always return false.
106
- *
107
- * @param string $permissionName the name of the permission (e.g. "edit post") that needs access check.
108
- * @param array $params name-value pairs that would be passed to the rules associated
109
- * with the roles and permissions assigned to the user.
110
- * @param bool $allowCaching whether to allow caching the result of access check.
111
- * When this parameter is true (default), if the access check of an operation was performed
112
- * before, its result will be directly returned when calling this method to check the same
113
- * operation. If this parameter is false, this method will always call
114
- * [[\yii\rbac\CheckAccessInterface::checkAccess()]] to obtain the up-to-date access result. Note that this
115
- * caching is effective only within the same request and only works when `$params = []`.
116
- * @return bool whether the user can perform the operation as specified by the given permission.
117
- */
118
- // public function can($permissionName, $params = [], $allowCaching = true)
119
- // {
120
- // if ($allowCaching && empty($params) && isset($this->_access[$permissionName])) {
121
- // return $this->_access[$permissionName];
122
- // }
123
- // if (($accessChecker = $this->getAccessChecker()) === null) {
124
- // return false;
125
- // }
126
- // $access = $accessChecker->checkAccess($this->getId(), $permissionName, $params);
127
- // if ($allowCaching && empty($params)) {
128
- // $this->_access[$permissionName] = $access;
129
- // }
130
- //
131
- // return $access;
132
- // }
133
- can(permissionName, params = [], allowCaching = true) {
134
- return __awaiter(this, void 0, void 0, function* () {
135
- let access;
136
- let accessChecker;
137
- if ((accessChecker = this.getAccessChecker()) == null)
138
- return false;
139
- access = yield accessChecker.checkAccess(this.getId(), permissionName, params);
140
- if (allowCaching && Utils_1.Utils.isEmpty(params)) {
141
- // this._access[$permissionName] = $access;
142
- }
143
- return access;
144
- });
145
- }
146
- /**
147
- * Returns auth manager associated with the user component.
148
- *
149
- * By default this is the `authManager` application component.
150
- * You may override this method to return a different auth manager instance if needed.
151
- * @return \yii\rbac\ManagerInterface
152
- * @since 2.0.6
153
- */
154
- getAuthManager() {
155
- return BaseChyz_1.default.getComponent('authManager');
156
- }
157
- /**
158
- * Returns the access checker used for checking access.
159
- * @return CheckAccessInterface
160
- */
161
- getAccessChecker() {
162
- return this.accessChecker !== null ? this.accessChecker : this.getAuthManager();
163
- }
164
- }
165
- exports.WebUser = WebUser;