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() { getPossibleRoles() {
return this.user.getRoles(); return this.loginPromise.then(() => this.user.getRoles());
} }
getPossibleMissionActions() { getPossibleMissionActions() {

View File

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