mirror of
https://github.com/nasa/openmct.git
synced 2024-12-19 21:27:52 +00:00
changing how we pass in the options, so you can do one at a time, as well as return possible roles after login promise has resolved
This commit is contained in:
parent
810d580b18
commit
b59ed09274
@ -141,7 +141,7 @@ export default class ExampleUserProvider extends EventEmitter {
|
||||
}
|
||||
|
||||
getPossibleRoles() {
|
||||
return this.user.getRoles();
|
||||
return this.loginPromise.then(() => this.user.getRoles());
|
||||
}
|
||||
|
||||
getPossibleMissionActions() {
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user