Compare commits

...

1 Commits

2 changed files with 6 additions and 7 deletions

View File

@ -141,7 +141,7 @@ export default class ExampleUserProvider extends EventEmitter {
}
getPossibleRoles() {
return this.user.getRoles();
return this.loginPromise.then(() => this.user.getRoles());
}
getPossibleMissionActions() {

View File

@ -24,12 +24,11 @@ import ExampleUserProvider from './ExampleUserProvider.js';
const AUTO_LOGIN_USER = 'mct-user';
const STATUS_ROLES = ['flight', 'driver'];
export default function ExampleUserPlugin(
{ autoLoginUser, statusRoles } = {
autoLoginUser: AUTO_LOGIN_USER,
statusRoles: STATUS_ROLES
}
) {
export default function ExampleUserPlugin(options = {}) {
const {
autoLoginUser = AUTO_LOGIN_USER,
statusRoles = STATUS_ROLES
} = options;
return function install(openmct) {
const userProvider = new ExampleUserProvider(openmct, {
statusRoles