@firecms/user_management 3.0.0-beta.10 → 3.0.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,6 +1,7 @@
1
1
  import { UserManagement } from "../types";
2
- import { DataSourceDelegate } from "@firecms/core";
3
- export interface UserManagementParams {
2
+ import { AuthController, DataSourceDelegate, User } from "@firecms/core";
3
+ export interface UserManagementParams<CONTROLLER extends AuthController<any> = AuthController<any>> {
4
+ authController: CONTROLLER;
4
5
  /**
5
6
  * The delegate in charge of persisting the data.
6
7
  */
@@ -18,14 +19,6 @@ export interface UserManagementParams {
18
19
  * Default: __FIRECMS/config/roles
19
20
  */
20
21
  rolesPath?: string;
21
- /**
22
- * Maximum number of users that can be created.
23
- */
24
- usersLimit?: number;
25
- /**
26
- * Can the logged user edit roles
27
- */
28
- canEditRoles?: boolean;
29
22
  /**
30
23
  * If there are no roles in the database, provide a button to create the default roles.
31
24
  */
@@ -38,12 +31,11 @@ export interface UserManagementParams {
38
31
  /**
39
32
  * This hook is used to build a user management object that can be used to
40
33
  * manage users and roles in a Firestore backend.
34
+ * @param authController
41
35
  * @param dataSourceDelegate
42
36
  * @param usersPath
43
37
  * @param rolesPath
44
- * @param usersLimit
45
- * @param canEditRoles
46
38
  * @param allowDefaultRolesCreation
47
39
  * @param includeCollectionConfigPermissions
48
40
  */
49
- export declare function useBuildUserManagement({ dataSourceDelegate, usersPath, rolesPath, usersLimit, canEditRoles, allowDefaultRolesCreation, includeCollectionConfigPermissions }: UserManagementParams): UserManagement;
41
+ export declare function useBuildUserManagement<CONTROLLER extends AuthController<any> = AuthController<any>, USER extends User = CONTROLLER extends AuthController<infer U> ? U : any>({ authController, dataSourceDelegate, usersPath, rolesPath, allowDefaultRolesCreation, includeCollectionConfigPermissions }: UserManagementParams<CONTROLLER>): UserManagement<USER> & CONTROLLER;