import { Observable, BehaviorSubject } from 'rxjs'

export class User {
    _roles: BehaviorSubject<Role[]>
    roles$: Observable<Role[]>
    constructor(
        public id: number,
        public name: string,
        public email: string,
        public active: boolean,
        public password?: string,
    ) {
        this._roles = new BehaviorSubject<Role[]>([])
        this.roles$ = this._roles.asObservable()
    }
}

export class Role {
    constructor(
        public id: number,
        public name: string,
        public description: string,
    ) {}
}

export class ACL {
    constructor(
        public user_id: number,
        public role_ids: number[],
    ) {}
}
