User Group Administrationのロゴ

User Group Administration

組織
serac-labs
user-group-administration

Manage the principals ACLs apply to — sys_user, sys_user_group, sys_user_grmember and sys_user_has_role. Group before membership, inherited versus direct roles, why removing a role does not always remove the access, and deactivate rather than delete.

概要

公開者serac-labs
リポジトリserac
スキル名user-group-administration
スター
77
フォーク
28
同梱ファイル
指示のみ
ライセンスApache-2.0
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 指示だけで完結

    モデルに必要なものはすべて指示に含まれているため、別途同期するファイルはありません。

  • オープンソース

    serac-labsがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキル「User Group Administration」をTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/serac-labs/serac/tree/main/packages/skills/user-group-administration
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/serac-labs/serac.git /tmp/serac
mkdir -p .claude/skills
cp -r /tmp/serac/packages/skills/user-group-administration .claude/skills/user-group-administration
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでUser Group Administrationを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあるとすぐに、モデルが自動的にUser Group Administrationを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、User Group Administrationは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、スキルを使わない間は指示の読み込みにトークンを消費しません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Users, Groups and Roles

acl-security teaches the rules. This teaches the things the rules apply to. Without it an agent asked to "add Sam to the change team" writes a background script against sys_user_grmember, which works right up until it silently creates a second membership row.

Four tables

TableHolds
sys_userpeople
sys_user_groupgroups
sys_user_grmemberone row per (user, group) membership
sys_user_has_roleone row per (user, role) grant — direct and inherited

There is no list of members on the group and no list of roles on the user. Both are join tables, and both are where the work happens.

Order of operations

Group before membership, role before grant. Every one of these is a reference field with no auto-create behind it:

javascript
// 1. the group
const grp = await snow_role_group_manage({ action: "create_group", name: "Database — Change",
                                           manager: managerSysId, description: "Owns DB change approvals" })

// 2. then people into it — takes sys_id, username OR email, so no lookup step
await snow_manage_group_membership({ action: "add", group_identifier: "Database — Change",
                                     user_identifier: "sam.patel@example.com" })

// 3. and a role onto the group, so membership grants it
await snow_role_group_manage({ action: "assign_role", role: roleSysId, group: grp.sys_id })

snow_manage_group_membership checks for an existing membership before inserting, which a hand-written GlideRecord.insert() does not. Duplicate sys_user_grmember rows do not break access — they break removal, because the remove path deletes one row and the user is still a member.

Inherited versus direct: the part that bites

A role reaches a user two ways, and sys_user_has_role holds both:

  • Direct — a row with inherited = false, created when someone grants the role to the person.
  • Inherited — a row with inherited = true, created by the platform when the user joins a group that has the role, or when a role the user holds contains another role.

snow_get_user_roles returns every row on sys_user_has_role for the user, with display values. Read the inherited flag on each one before concluding anything:

javascript
const roles = await snow_get_user_roles({ user_id: userSysId })
const direct = roles.roles.filter((r) => r.inherited === "false")

This is why removing a role does not always remove the access. Revoke the direct grant and the user still holds the role, because a group they are in also grants it — the inherited row is untouched and was never yours to delete. Two rules follow:

  1. Before revoking, look at all the rows for that role. If any is inherited=true, the fix is group membership, not the grant.
  2. Never delete an inherited=true row by hand. The platform maintains those; it will recreate them, and in the meantime access does not change.

Role containment compounds this: itil_admin contains itil, so granting the first produces an inherited itil row as well. Someone who "only has itil_admin" has both.

One caution on assign_role with a group

snow_role_group_manage({ action: "assign_role", group }) writes its row to sys_user_has_role. On a stock instance the group→role join is sys_group_has_role, so verify what landed before you rely on it:

javascript
await snow_query_table({ table: "sys_group_has_role", query: "group=" + grp.sys_id, fields: "role,inherited" })

If that comes back empty after the call, grant the role to the group in the UI (Group → Roles related list) instead and use the tool only for user grants.

Deactivate, never delete

snow_user_manage({ action: "deactivate", user_id }) sets active = false. That is the only removal the tool offers, deliberately.

A sys_user record is referenced from every task the person ever touched — opened_by, assigned_to, sys_created_by, every journal entry, every approval. Deleting it leaves those references dangling and the history unreadable. Deactivating it blocks login, drops the user out of assignment lookups, and keeps every reference intact.

Deactivation does not remove group memberships or roles. Those rows stay, which is correct — if the person returns, or if an audit asks what access they had in March, the answer is still there. If access must be provably gone as well, remove the memberships explicitly:

javascript
const groups = await snow_query_table({ table: "sys_user_grmember", query: "user=" + userSysId,
                                        fields: "group" })
for (const row of groups.records) {
  await snow_manage_group_membership({ action: "remove", user_identifier: userSysId,
                                       group_identifier: row.group.value })
}
await snow_user_manage({ action: "deactivate", user_id: userSysId })

Same for groups: a group with history should be deactivated (active = false), not deleted. Deleting one orphans every sys_user_grmember row pointing at it and every assignment that used it.

Reading before writing

Two queries answer most "who can do X" questions without changing anything:

javascript
// everyone in a group, with details
await snow_manage_group_membership({ action: "list", group_identifier: "Database — Change" })

// every group a user is in
await snow_query_table({ table: "sys_user_grmember", query: "user=" + userSysId, fields: "group" })

Related

  • acl-security — what the roles are checked against.
  • instance-security — instance-level hardening; a different subject from who holds what.
  • domain-separation — on a domain-separated instance, a group and its members live in a domain, and a membership across domains does not do what it looks like.

よくある質問

AIスキル「User Group Administration」では何ができますか?

Manage the principals ACLs apply to — sys_user, sys_user_group, sys_user_grmember and sys_user_has_role. Group before membership, inherited versus direct roles, why removing a role does not always remove the access, and deactivate rather than delete.

TypingMindでUser Group Administrationを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。User Group Administrationはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにUser Group Administrationをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/serac-labs/serac/tree/main/packages/skills/user-group-administrationを貼り付けてください。TypingMindがSKILL.mdを読み込み、チャットごとに有効にできるスキルとしてインストールします。

User Group Administrationを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストの内容がこのスキルの用途に合ったときに、このスキルを読み込めます。

User Group Administrationで使えるAIモデルの数に制限はありますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもUser Group Administrationを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「User Group Administration」は無料ですか?

はい。serac-labsがApache-2.0ライセンスのもとでGitHubに公開しています。ご利用のAIプロバイダーに支払うのは、使用したトークンの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇