Skip to content
Back to skills

Glean Enterprise Rbac

ASecurity

'Map AD/Okta groups to Glean document permissions using allowedGroups.

  • 2,688 stars
  • 0 votes
  • 0 copies
  • 4 views
  • Added May 29, 2026
ai-agentstypescriptgobashrailsapisecurity

Works with

  • claude code
  • cli
  • api

Security analysis

A100/100

Scanned May 29, 2026

npx -y skills add jeremylongshore/claude-code-plugins-plus-skills --skill glean-enterprise-rbac --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Glean Enterprise Rbac?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Glean Enterprise Rbac
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/jeremylongshore-glean-enterprise-rbac/badge)](https://www.skillsdirectory.com/skills/jeremylongshore-glean-enterprise-rbac)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: glean-enterprise-rbac
description: 'Map AD/Okta groups to Glean document permissions using allowedGroups.

  Trigger: "glean enterprise rbac", "enterprise-rbac".

  '
allowed-tools: Read, Write, Edit, Bash(npm:*), Bash(curl:*), Grep
version: 1.0.0
license: MIT
author: Jeremy Longshore <jeremy@intentsolutions.io>
tags:
- saas
- enterprise-search
- glean
compatibility: Designed for Claude Code
---
# Glean Enterprise RBAC

## Overview

Glean's enterprise search aggregates content from dozens of connectors (Google Drive, Confluence, Slack, Salesforce). RBAC ensures users only see documents they are authorized to access. Permissions flow from source systems through connector-level ACLs into Glean's unified index. Misconfigured permissions mean search results leak sensitive data across teams. SOC 2 and GDPR compliance require document-level access control and full audit trails on who searched what.

## Role Hierarchy

| Role | Permissions | Scope |
|------|------------|-------|
| Super Admin | Create API tokens, manage all connectors, configure SSO | Organization-wide |
| Admin | Add/edit datasources, manage user groups, view analytics | Assigned datasources |
| Content Manager | Set document permissions, manage allowedGroups per datasource | Own datasources |
| User | Search and view permitted documents | Documents matching ACLs |
| Viewer | Search only, no document previews or snippets | Restricted document set |

## Permission Check

```typescript
async function checkDocumentAccess(userId: string, documentId: string): Promise<boolean> {
  const response = await fetch(`${GLEAN_API}/permissions/check`, {
    method: 'POST',
    headers: { Authorization: `Bearer ${GLEAN_API_TOKEN}`, 'Content-Type': 'application/json' },
    body: JSON.stringify({ userId, documentId }),
  });
  const result = await response.json();
  return result.hasAccess ?? false;
}
```

## Role Assignment

```typescript
async function assignDatasourceRole(email: string, datasource: string, role: 'admin' | 'viewer'): Promise<void> {
  await fetch(`${GLEAN_API}/datasources/${datasource}/permissions`, {
    method: 'PUT',
    headers: { Authorization: `Bearer ${GLEAN_API_TOKEN}`, 'Content-Type': 'application/json' },
    body: JSON.stringify({ user: email, role, allowedGroups: [`${datasource}-${role}s`] }),
  });
}

async function revokeDatasourceAccess(email: string, datasource: string): Promise<void> {
  await fetch(`${GLEAN_API}/datasources/${datasource}/permissions/${email}`, {
    method: 'DELETE',
    headers: { Authorization: `Bearer ${GLEAN_API_TOKEN}` },
  });
}
```

## Audit Logging

```typescript
interface GleanAuditEntry {
  timestamp: string; userId: string; action: 'search' | 'view' | 'index' | 'permission_change';
  datasource: string; query?: string; documentId?: string; result: 'allowed' | 'denied';
}

function logSearchAccess(entry: GleanAuditEntry): void {
  console.log(JSON.stringify({ ...entry, org: process.env.GLEAN_ORG_ID }));
}
```

## RBAC Checklist

- [ ] Each connector maps source-system ACLs to Glean allowedGroups
- [ ] API tokens scoped per datasource, not organization-wide
- [ ] SAML/SSO groups synced with Glean user groups daily
- [ ] Document-level permissions verified after each connector sync
- [ ] Search analytics reviewed monthly for unauthorized access patterns
- [ ] Token rotation policy enforced quarterly
- [ ] Sensitive datasources restricted to named allowedGroups only

## Error Handling

| Issue | Cause | Fix |
|-------|-------|-----|
| User sees documents from wrong team | AllowedGroups not mapped to connector | Reconfigure connector ACL mapping in admin console |
| `403 Forbidden` on search API | Expired or wrong-scope API token | Regenerate token with correct datasource scope |
| Stale permissions after IdP change | Connector sync lag | Trigger manual resync from Glean admin |
| Missing search results | Overly restrictive allowedGroups | Audit group membership against source system ACLs |

## Resources

- [Glean Developer Portal](https://developers.glean.com/)
- [Indexing API](https://developers.glean.com/api-info/indexing/getting-started/overview)
- [Search API](https://developers.glean.com/api/client-api/search/overview)

## Next Steps

See `glean-security-basics`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.