Skip to content

Commit

Permalink
fix: no administrator privileges
Browse files Browse the repository at this point in the history
  • Loading branch information
hung-cybo authored and tuanphamcybozu committed May 8, 2024
1 parent f8405a1 commit b875af3
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import { ControllerBase } from "./ControllerBase";

const DETECT_PAGE_TIMEOUT_MS = 10000;
const NO_PRIVILEGE_STATUS_CODE = "403";
const NO_PRIVILEGE_STATUS_CODE = "CB_NO02";

export interface BasicAuth {
username: string;
Expand Down Expand Up @@ -69,7 +69,11 @@ export default class PluginSystemController extends ControllerBase {
});

const response = await this.goToPluginSystemPage(baseUrl);
if (!response || response.headers().status === NO_PRIVILEGE_STATUS_CODE) {
if (
!response ||
(response.headers()["x-cybozu-error"] &&
response.headers()["x-cybozu-error"] === NO_PRIVILEGE_STATUS_CODE)
) {
throw chalk.red(boundMessage("Error_adminPrivilege"));
}

Expand Down

0 comments on commit b875af3

Please sign in to comment.