mirror of
https://github.com/nasa/openmct.git
synced 2024-12-20 05:37:53 +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() {
|
getPossibleRoles() {
|
||||||
return this.user.getRoles();
|
return this.loginPromise.then(() => this.user.getRoles());
|
||||||
}
|
}
|
||||||
|
|
||||||
getPossibleMissionActions() {
|
getPossibleMissionActions() {
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user