// Run this script once from your project folder
const admin = require('firebase-admin');
const serviceAccount = require('./serviceAccount.json');

admin.initializeApp({
    credential: admin.credential.cert(serviceAccount)
});

const email = 'sibusiso@ideapioneers.co.za';

admin.auth().getUserByEmail(email)
    .then(user => {
        return admin.auth().setCustomUserClaims(user.uid, { admin: true });
    })
    .then(() => {
        console.log('Admin role assigned successfully');
        process.exit();
    })
    .catch(err => {
        console.error('Error:', err);
        process.exit(1);
    });