@temboplus/afloat 0.2.0-beta.11 → 0.2.0-beta.12
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.
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { Permission } from "../login/permission.type.js";
|
|
2
1
|
import { Profile } from "../profile/profile.model.js";
|
|
3
2
|
import { LogIn } from "../login/login.model.js";
|
|
4
3
|
import { CompanyMembership } from "./company-membership.model.js";
|
|
@@ -208,7 +207,6 @@ export type UserData = {
|
|
|
208
207
|
export declare class User {
|
|
209
208
|
private readonly _logIn;
|
|
210
209
|
private readonly _membership;
|
|
211
|
-
private readonly _permissionMap;
|
|
212
210
|
private constructor();
|
|
213
211
|
/**
|
|
214
212
|
* Creates a User instance from the provided data.
|
|
@@ -230,6 +228,10 @@ export declare class User {
|
|
|
230
228
|
* Gets the user's login data.
|
|
231
229
|
*/
|
|
232
230
|
get logIn(): LogIn;
|
|
231
|
+
/**
|
|
232
|
+
* Gets the user's login data.
|
|
233
|
+
*/
|
|
234
|
+
get login(): LogIn;
|
|
233
235
|
/**
|
|
234
236
|
* Gets the user's company membership (includes company profile and role).
|
|
235
237
|
*/
|
|
@@ -266,35 +268,6 @@ export declare class User {
|
|
|
266
268
|
* Convenience getter for permissions array.
|
|
267
269
|
*/
|
|
268
270
|
get access(): ReadonlyArray<string>;
|
|
269
|
-
/**
|
|
270
|
-
* Checks if the user has a specific permission.
|
|
271
|
-
*
|
|
272
|
-
* @param permission - The permission to check
|
|
273
|
-
* @returns true if the user has the permission
|
|
274
|
-
*/
|
|
275
|
-
can(permission: Permission): boolean;
|
|
276
|
-
/**
|
|
277
|
-
* Checks if the user has any of the specified permissions.
|
|
278
|
-
*
|
|
279
|
-
* @param permissions - Array of permissions to check
|
|
280
|
-
* @returns true if the user has at least one permission
|
|
281
|
-
*/
|
|
282
|
-
canAny(permissions: Permission[]): boolean;
|
|
283
|
-
/**
|
|
284
|
-
* Checks if the user has all of the specified permissions.
|
|
285
|
-
*
|
|
286
|
-
* @param permissions - Array of permissions to check
|
|
287
|
-
* @returns true if the user has all permissions
|
|
288
|
-
*/
|
|
289
|
-
canAll(permissions: Permission[]): boolean;
|
|
290
|
-
/**
|
|
291
|
-
* Checks if the user can manage team members.
|
|
292
|
-
*/
|
|
293
|
-
canManageTeam(): boolean;
|
|
294
|
-
/**
|
|
295
|
-
* Checks if the user can view role details.
|
|
296
|
-
*/
|
|
297
|
-
canViewRoles(): boolean;
|
|
298
271
|
/**
|
|
299
272
|
* Serializes the User instance to a JSON-compatible object
|
|
300
273
|
*
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { LogInDTO } from "./login.dtos.js";
|
|
2
|
+
import { Permission } from "./permission.type.js";
|
|
2
3
|
import { z } from "zod";
|
|
3
4
|
/**
|
|
4
5
|
* Zod schema for LogIn JSON serialization
|
|
@@ -74,6 +75,7 @@ export declare class LogIn {
|
|
|
74
75
|
private readonly _createdAt;
|
|
75
76
|
private readonly _updatedAt;
|
|
76
77
|
private readonly _access;
|
|
78
|
+
private readonly _permissionMap;
|
|
77
79
|
private constructor();
|
|
78
80
|
/**
|
|
79
81
|
* Creates a LogIn instance from a validated DTO.
|
|
@@ -149,6 +151,27 @@ export declare class LogIn {
|
|
|
149
151
|
* Gets the user's permissions/access list.
|
|
150
152
|
*/
|
|
151
153
|
get access(): ReadonlyArray<string>;
|
|
154
|
+
/**
|
|
155
|
+
* Checks if the login has a specific permission.
|
|
156
|
+
*
|
|
157
|
+
* @param permission - The permission to check
|
|
158
|
+
* @returns true if the login has the permission
|
|
159
|
+
*/
|
|
160
|
+
can(permission: Permission): boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Checks if the login has any of the specified permissions.
|
|
163
|
+
*
|
|
164
|
+
* @param permissions - Array of permissions to check
|
|
165
|
+
* @returns true if the login has at least one permission
|
|
166
|
+
*/
|
|
167
|
+
canAny(permissions: Permission[]): boolean;
|
|
168
|
+
/**
|
|
169
|
+
* Checks if the login has all of the specified permissions.
|
|
170
|
+
*
|
|
171
|
+
* @param permissions - Array of permissions to check
|
|
172
|
+
* @returns true if the login has all permissions
|
|
173
|
+
*/
|
|
174
|
+
canAll(permissions: Permission[]): boolean;
|
|
152
175
|
/**
|
|
153
176
|
* Serializes the LogIn instance to a JSON-compatible object
|
|
154
177
|
*/
|