Add choral permissions
This commit is contained in:
20
src/index.ts
20
src/index.ts
@@ -1,4 +1,4 @@
|
||||
// import type { Core } from '@strapi/strapi';
|
||||
import type { Core } from "@strapi/strapi";
|
||||
|
||||
export default {
|
||||
/**
|
||||
@@ -16,5 +16,21 @@ export default {
|
||||
* This gives you an opportunity to set up your data model,
|
||||
* run jobs, or perform some special logic.
|
||||
*/
|
||||
bootstrap(/* { strapi }: { strapi: Core.Strapi } */) {},
|
||||
bootstrap({ strapi }: { strapi: Core.Strapi }) {
|
||||
strapi.db.lifecycles.subscribe({
|
||||
models: ["plugin::users-permissions.user"], // Applies only to users in users-permissions
|
||||
|
||||
/**
|
||||
* Lifecycle hook triggered after a new user is created.
|
||||
* Ensures that a user profile is created with either the provided full name and bio
|
||||
* or a default generated username and bio if missing.
|
||||
* @param {any} event - The event object containing the created user's details.
|
||||
*/
|
||||
async afterCreate(event: any) {
|
||||
const { result, params } = event;
|
||||
console.log(result);
|
||||
console.log(params);
|
||||
},
|
||||
});
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user