mirror of
https://github.com/nasa/openmct.git
synced 2024-12-27 16:38:51 +00:00
Add additional test roles to example user
This commit is contained in:
parent
172e0b23fd
commit
f5d57210ae
@ -21,14 +21,20 @@
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
import ExampleUserProvider from './ExampleUserProvider';
|
import ExampleUserProvider from './ExampleUserProvider';
|
||||||
|
const AUTO_LOGIN_USER = 'guest';
|
||||||
|
const STATUS_ROLES = ['test-role-1', 'test-role-2', 'test-role-3'];
|
||||||
|
const DEFAULT_STATUS_ROLE = STATUS_ROLES[2];
|
||||||
|
|
||||||
export default function ExampleUserPlugin({autoLoginUser, defaultStatusRole} = {
|
export default function ExampleUserPlugin({autoLoginUser, statusRoles, defaultStatusRole} = {
|
||||||
autoLoginUser: 'guest',
|
autoLoginUser: AUTO_LOGIN_USER,
|
||||||
defaultStatusRole: 'test-role'
|
statusRoles: STATUS_ROLES,
|
||||||
|
defaultStatusRole: DEFAULT_STATUS_ROLE
|
||||||
}) {
|
}) {
|
||||||
return function install(openmct) {
|
return function install(openmct) {
|
||||||
|
const defaultStatusRoleOrFirstItem = statusRoles.includes(defaultStatusRole) ? defaultStatusRole : statusRoles[0];
|
||||||
const userProvider = new ExampleUserProvider(openmct, {
|
const userProvider = new ExampleUserProvider(openmct, {
|
||||||
defaultStatusRole
|
statusRoles,
|
||||||
|
defaultStatusRole: defaultStatusRoleOrFirstItem
|
||||||
});
|
});
|
||||||
|
|
||||||
if (autoLoginUser !== undefined) {
|
if (autoLoginUser !== undefined) {
|
||||||
|
Loading…
Reference in New Issue
Block a user