boostercloud / booster

Booster Framework
https://www.boosterframework.com
Apache License 2.0
416 stars 87 forks source link

The roles.ts file should be created automatically as part of the initial scaffolding #1227

Open jfsagasti opened 1 year ago

jfsagasti commented 1 year ago

Feature Request

Description

When generating the initial project scaffolding, the file src/config/roles.ts mentioned in the documentation should be automatically created as well.

Possible Solution

Create the roles.ts file as part of the initial scaffolding, or ask at least during the CLI init if you plan to use authentication.

In the file, include a commented example of how a role could look:

import { Role } from '@boostercloud/framework-core'

@Role()
export class User {}
javiertoledo commented 1 year ago

That file is actually a leftover of the authentication rocket that was removed from the core. We should probably rework that rocket in a way that also helps you to set roles up and move the @Role decorator as well as the role-based authorized to the rocket repository.