-
Notifications
You must be signed in to change notification settings - Fork 359
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6f9634b
commit 8cbd13f
Showing
7 changed files
with
46 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { isRbacEnabled } from 'e2e/utils/rbac'; | ||
|
||
export const defaultURL = isRbacEnabled() ? /workspaces/ : /dashboard/; | ||
|
||
export const defaultTitle = isRbacEnabled() ? 'Workspaces' : 'Home'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import { detExecSync } from 'e2e/utils/detCLI'; | ||
|
||
let rbacEnabled: boolean; | ||
|
||
const getRbacEnabled = (): boolean => { | ||
const masterInfo = detExecSync('master info'); | ||
const regexp = /rbacEnabled:\s*(?<enabled>true|false)/; | ||
|
||
const { groups } = regexp.exec(masterInfo) || {}; | ||
|
||
return groups?.enabled === 'true'; | ||
}; | ||
|
||
export const isRbacEnabled = (): boolean => { | ||
if (rbacEnabled === undefined) rbacEnabled = getRbacEnabled(); | ||
|
||
return rbacEnabled; | ||
}; |