Install any skill in seconds. Free to start, no credit card required.
Get Started Free →Implement enterprise role-based access control with Linear. Use when setting up team permissions, OAuth scopes, SAML SSO, SCIM provisioning, or audit logging. Trigger: "linear RBAC", "linear permissions", "linear SSO", "linear enterprise access", "linear role management", "linear SCIM".
.claude/skills/jeremylongshore-linear-enterprise-rbac/SKILL.md| Test case | Without → With | Effect | Δ tokens | Δ turns |
|---|---|---|---|---|
| case-01 | ✗→✓ | ▲ Improved | 41% | 0% |
| case-02 | ✗→✓ | ▲ Improved | 65% | 0% |
| case-17 | ✗→✓ | ▲ Improved | 86% | 0% |
| case-03 | ✓→✓ | = Same ✓ | 9% | 0% |
| case-04 | ✓→✓ | = Same ✓ | 117% | 0% |
Implement role-based access control for Linear integrations. Linear provides built-in organization roles (Owner, Admin, Member, Guest), team-level access control, and fine-grained OAuth scopes. Enterprise plans add SAML 2.0 SSO and SCIM user provisioning.
| Role | Capabilities | |------|-------------| | Owner | Full workspace control, billing, delete workspace | | Admin | Manage members, teams, integrations, workspace settings | | Member | Create/edit issues, access team-visible data | | Guest | Read-only access to invited teams only |
These roles are fixed in Linear. Your application can layer additional permissions on top.
typescript// src/auth/permissions.ts // Available Linear OAuth scopes: // read, write, issues:create, admin // initiative:read, initiative:write // customer:read, customer:write const ROLE_SCOPES: Record<string, string[]> = { admin: ["read", "write", "issues:create", "admin"], manager: ["read", "write", "issues:create"], developer: ["read", "write", "issues:create"], viewer: ["read"], }; const TEAM_ACCESS: Record<string, "member" | "guest" | "none"> = { admin: "member", manager: "member", developer: "member", viewer: "guest", };
typescriptimport { LinearClient } from "@linear/sdk"; interface UserContext { userId: string; role: string; linearClient: LinearClient; teamIds: string[]; } class PermissionGuard { constructor(private ctx: UserContext) {} canAccessTeam(teamId: string): boolean { if (this.ctx.role === "admin") return true; return this.ctx.teamIds.includes(teamId); } async canModifyIssue(issueId: string): Promise<boolean> { if (this.ctx.role === "viewer") return false; const issue = await this.ctx.linearClient.issue(issueId); const team = await issue.team; return team ? this.canAccessTeam(team.id) : false; } canCreateIssue(): boolean { return ["admin", "manager", "developer"].includes(this.ctx.role); } canDeleteIssue(): boolean { return this.ctx.role === "admin"; } canManageIntegration(): boolean { return this.ctx.role === "admin"; } canAccessProject(projectTeamIds: string[]): boolean { if (this.ctx.role === "admin") return true; return projectTeamIds.some(id => this.ctx.teamIds.includes(id)); } } // Express middleware function requireRole(...allowedRoles: string[]) { return (req: any, res: any, next: any) => { if (!allowedRoles.includes(req.user.role)) { return res.status(403).json({ error: "Insufficient role" }); } next(); }; } // Route protection app.post("/api/issues", requireRole("admin", "manager", "developer"), createIssueHandler); app.delete("/api/issues/:id", requireRole("admin"), deleteIssueHandler); app.get("/api/issues", requireRole("admin", "manager", "developer", "viewer"), listIssuesHandler);
typescript// Create Linear clients with appropriate access per user async function getClientForUser(userId: string): Promise<LinearClient> { const token = await getStoredOAuthToken(userId); if (!token) throw new Error("User not authenticated with Linear"); return new LinearClient({ accessToken: token }); } // Verify team membership via API async function getUserTeamIds(client: LinearClient): Promise<string[]> { const viewer = await client.viewer; const memberships = await viewer.teamMemberships(); const teamIds: string[] = []; for (const membership of memberships.nodes) { const team = await membership.team; if (team) teamIds.push(team.id); } return teamIds; }
typescript// Linear Enterprise supports SAML 2.0 SSO // Configuration: Linear Settings > Security > SAML // After SSO login, verify user's Linear access async function onSSOLogin(email: string): Promise<UserContext> { // Look up user's stored OAuth token const user = await db.users.findByEmail(email); if (!user?.linearAccessToken) { throw new Error("User must complete Linear OAuth after SSO login"); } const client = new LinearClient({ accessToken: user.linearAccessToken }); const viewer = await client.viewer; const teamIds = await getUserTeamIds(client); return { userId: user.id, role: mapLinearRoleToAppRole(viewer), linearClient: client, teamIds, }; } function mapLinearRoleToAppRole(viewer: any): string { if (viewer.admin) return "admin"; if (viewer.guest) return "viewer"; return "developer"; }
typescript// SCIM auto-syncs users and groups from your IdP to Linear // Configuration: Linear Settings > Security > SCIM provisioning // Endpoint: https://api.linear.app/scim/v2 // Bearer token: generated in Linear admin settings // After SCIM syncs users, verify in your app async function syncSCIMUsers(client: LinearClient) { const org = await client.organization; const members = await org.users(); for (const user of members.nodes) { console.log(`${user.name} (${user.email}): admin=${user.admin}, guest=${user.guest}, active=${user.active}`); // Sync to your app's user database await db.users.upsert({ email: user.email, name: user.name, linearId: user.id, role: user.admin ? "admin" : user.guest ? "viewer" : "developer", active: user.active, }); } }
typescriptinterface AuditEntry { timestamp: string; userId: string; action: string; resource: string; resourceId: string; details: Record<string, unknown>; } function logAudit(entry: AuditEntry): void { // Write to audit log (database, SIEM, CloudWatch, etc.) console.log(JSON.stringify(entry)); } // Wrap Linear operations with audit logging async function auditedCreateIssue( ctx: UserContext, input: { teamId: string; title: string; [key: string]: any } ) { const guard = new PermissionGuard(ctx); if (!guard.canCreateIssue()) throw new Error("Forbidden"); if (!guard.canAccessTeam(input.teamId)) throw new Error("No team access"); const result = await ctx.linearClient.createIssue(input); logAudit({ timestamp: new Date().toISOString(), userId: ctx.userId, action: "issue.create", resource: "Issue", resourceId: (await result.issue)?.id ?? "", details: { teamId: input.teamId, title: input.title }, }); return result; } async function auditedUpdateIssue( ctx: UserContext, issueId: string, updates: Record<string, unknown> ) { const guard = new PermissionGuard(ctx); if (!(await guard.canModifyIssue(issueId))) throw new Error("Forbidden"); logAudit({ timestamp: new Date().toISOString(), userId: ctx.userId, action: "issue.update", resource: "Issue", resourceId: issueId, details: updates, }); return ctx.linearClient.updateIssue(issueId, updates); }
| Error | Cause | Solution | |-------|-------|----------| | Forbidden | Token lacks required scope | Request OAuth with correct ROLE_SCOPES | | Authentication required | SSO session expired | Redirect to SAML IdP | | SCIM sync fails | Invalid bearer token | Regenerate SCIM token in Linear admin | | Guest can't create issue | Guest role is read-only | Upgrade to Member role in Linear | | Team not accessible | User not added to team | Add user to team in Linear Settings |
typescriptconst client = new LinearClient({ apiKey: process.env.LINEAR_API_KEY! }); const org = await client.organization; const members = await org.users(); for (const user of members.nodes) { const role = user.admin ? "admin" : user.guest ? "guest" : "member"; console.log(`${user.name} (${user.email}): ${role}`); }
| Case | Status | Duration (ms) | Turns | Tokens | Tool calls | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Without | With | Δ | Without | With | Δ | Without | With | Δ | Without | With | Δ | ||
case-01 | fail→pass | 25,077 | 22,434 | -11% | 1 | 1 | 0% | 4,313 | 6,069 | +41% | 0 | 0 | — |
case-02 | fail→pass | 23,356 | 21,455 | -8% | 1 | 1 | 0% | 3,510 | 5,775 | +65% | 0 | 0 | — |
case-03 | pass→pass | 29,987 | 20,516 | -32% | 1 | 1 | 0% | 5,273 | 5,756 | +9% | 0 | 0 | — |
case-04 | pass→pass | 15,999 | 14,498 | -9% | 1 | 1 | 0% | 1,822 | 3,946 | +117% | 0 | 0 | — |
case-05 | pass→pass | 15,789 | 16,124 | +2% | 1 | 1 | 0% | 1,731 | 4,273 | +147% | 0 | 0 | — |
case-11 | pass→pass | 11,154 | 7,786 | -30% | 1 | 1 | 0% | 1,609 | 2,830 | +76% | 0 | 0 | — |
case-06 | pass→pass | 18,288 | 14,661 | -20% | 1 | 1 | 0% | 2,064 | 3,934 | +91% | 0 | 0 | — |
case-07 | pass→pass | 17,552 | 11,436 | -35% | 1 | 1 | 0% | 1,681 | 3,447 | +105% | 0 | 0 | — |
case-08 | pass→pass | 16,289 | 14,371 | -12% | 1 | 1 | 0% | 1,712 | 4,035 | +136% | 0 | 0 | — |
case-09 | pass→pass | 16,402 | 12,936 | -21% | 1 | 1 | 0% | 1,998 | 3,841 | +92% | 0 | 0 | — |
case-10 | pass→pass | 12,448 | 9,468 | -24% | 1 | 1 | 0% | 1,017 | 3,074 | +202% | 0 | 0 | — |
case-12 | pass→pass | 11,431 | 4,782 | -58% | 1 | 1 | 0% | 1,187 | 2,949 | +148% | 0 | 0 | — |
case-13 | pass→pass | 23,581 | 15,898 | -33% | 1 | 1 | 0% | 2,606 | 4,396 | +69% | 0 | 0 | — |
case-14 | pass→pass | 11,949 | 4,499 | -62% | 1 | 1 | 0% | 1,918 | 3,168 | +65% | 0 | 0 | — |
case-15 | pass→pass | 11,239 | 13,631 | +21% | 1 | 1 | 0% | 1,868 | 4,128 | +121% | 0 | 0 | — |
case-16 | pass→pass | 8,320 | 7,548 | -9% | 1 | 1 | 0% | 1,000 | 2,753 | +175% | 0 | 0 | — |
case-17 | fail→pass | 17,080 | 4,431 | -74% | 1 | 1 | 0% | 1,694 | 3,153 | +86% | 0 | 0 | — |
case-18 | pass→pass | 9,314 | 15,179 | +63% | 1 | 1 | 0% | 1,578 | 3,800 | +141% | 0 | 0 | — |
case-19 | pass→pass | 8,629 | 8,051 | -7% | 1 | 1 | 0% | 1,273 | 2,866 | +125% | 0 | 0 | — |
case-20 | pass→pass | 17,034 | 12,981 | -24% | 1 | 1 | 0% | 1,680 | 3,534 | +110% | 0 | 0 | — |
case-21 | pass→pass | 18,327 | 15,112 | -18% | 1 | 1 | 0% | 2,609 | 5,074 | +94% | 0 | 0 | — |
case-22 | pass→pass | 17,791 | 22,036 | +24% | 1 | 1 | 0% | 2,619 | 4,906 | +87% | 0 | 0 | — |
case-23 | pass→pass | 18,341 | 15,224 | -17% | 1 | 1 | 0% | 2,565 | 5,346 | +108% | 0 | 0 | — |
DecimalAI ran this skill against gemini-3.6-flash twice over the same eval suite — once with the skill loaded and once without — and compared the two runs case by case. 23 cases were attempted. The headline lift of +13 percentage points is the difference between those two pass rates over the 23 comparable cases.
Without the skill loaded, the model failed this case. With it loaded, the same prompt on the same model passed. This is one improved case from the latest verified run; every case, including any that regressed, is in the table above.
Other measured skills in the registry, with their headline benchmark lift.