nirmalhk7:
I’m planning to use Strapi in a big group of people. I’d want to be able to make Admin accounts for all of them in one go. As far as I’m aware, I cant invite people to make Admin accounts, but I have about 30 people who I want to give access, and these would change every year.
I think it doesn’t exist. These are the pains of using a young platform, you wont get easy to use guides and tutorials. You can modify this guys code hopefully it helps. Good luck
module.exports = async () => {
if (process.env.NODE_ENV === 'development' || process.env.DEV_ADMIN_ALLOW == 'true') {
const params = {
username: process.env.DEV_ADMIN_USERNAME || 'admin',
password: process.env.DEV_ADMIN_PASSWORD || 'admin',
firstname: process.env.DEV_ADMIN_FIRSTNAME || 'Admin',
lastname: process.env.DEV_ADMIN_LASTNAME || 'Admin',
email: process.env.DEV_ADMIN_EMAIL || 'admin@strapi.dev',
blocked: false,
isActive: true,
};
//Check if any account exists.
try {
const admins = await strapi.query('user', 'admin').find();
if (admins.length === 0) {
let tempPass = params.password;
let verifyRole = await strapi.query('role', 'admin').findOne({
code: 'strapi-super-admin',
});
if (!verifyRole) {
This file has been truncated. show original