0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【kintone】アクセス権の設定を他のアプリに流用

0
Last updated at Posted at 2026-09-11

開発者ツールの Console で、下記のコードを実行すると
IDがAのアプリのアクセス権を、IDがBのアプリに適用できる。

appIdA appIdB の値は、実際のアプリIDに書き換えること。

const appIdA = A;
const appIdB = B;

// アプリのアクセス権
const appAcl = await kintone.api(
  kintone.api.url('/k/v1/preview/app/acl.json', true),
  'GET',
  { app: appIdA }
);

await kintone.api(
  kintone.api.url('/k/v1/preview/app/acl.json', true),
  'PUT',
  { app: appIdB, rights: appAcl.rights, revision: -1 }
);

// レコードのアクセス権
const recordAcl = await kintone.api(
  kintone.api.url('/k/v1/preview/record/acl.json', true),
  'GET',
  { app: appIdA }
);

await kintone.api(
  kintone.api.url('/k/v1/preview/record/acl.json', true),
  'PUT',
  { app: appIdB, rights: recordAcl.rights, revision: -1 }
);

// フィールドのアクセス権
const fieldAcl = await kintone.api(
  kintone.api.url('/k/v1/preview/field/acl.json', true),
  'GET',
  { app: appIdA }
);

await kintone.api(
  kintone.api.url('/k/v1/preview/field/acl.json', true),
  'PUT',
  { app: appIdB, rights: fieldAcl.rights, revision: -1 }
);

// デプロイ
await kintone.api(
  kintone.api.url('/k/v1/preview/app/deploy.json', true),
  'POST',
  { apps: [{ app: appIdB }] }
);
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?