Adonis-acl help

Don’t know where put this code:

const createUsersPermission = new Permission()
createUsersPermission.slug = 'create_users' = 'Create Users'
createUsersPermission.description = 'create users permission'

const updateUsersPermission = new Permission()
updateUsersPermission.slug = 'update_users' = 'Update Users'
updateUsersPermission.description = 'update users permission'

Maybe need to create separate ace command like seeds for creating roles and premissions

I’d probably just go ahead and do it with a seed file. Since you are basically just seeding the DB with these anyway, that makes sense to do with a seed to me.

adonis make:seed UserPermissions

Put your code in the run method in the resulting file.

1 Like

who make Relationships between user and permissions using seeds?