Add choral permissions

This commit is contained in:
2025-04-16 16:44:41 +02:00
parent d6d4bcfc33
commit 3cb23ef4b7
11 changed files with 186 additions and 12 deletions

View File

@@ -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);
},
});
},
};