Skip to content
lokalise-enterprise-rbac logo

Lokalise Enterprise RBAC

lokalise-enterprise-rbac

Configure Lokalise enterprise SSO, role-based access control, and team management. Use when implementing SSO integration, configuring role-based permissions, or setting up organization-level controls for Lokalise. Trigger with phrases like "lokalise SSO", "lokalise RBAC", "lokalise enterprise", "...

SKILL.md

Full skill instructions

Lokalise Enterprise RBAC

Overview

Configure enterprise-grade access control for Lokalise with teams, roles, and SSO.

Prerequisites

  • Lokalise Enterprise or Team plan
  • Identity Provider (IdP) for SSO (optional)
  • Understanding of role-based access patterns
  • Admin access to Lokalise organization

Lokalise Role Hierarchy

RoleScopePermissions
OwnerOrganizationFull control, billing, delete org
AdminOrganizationManage teams, projects, users
ManagerTeam/​ProjectManage project settings, contributors
DeveloperProjectRead/​write keys, translations
TranslatorProjectRead/​write translations only
ReviewerProjectReview and approve translations
ViewerProjectRead-only access

Instructions

Step 1: Define Role Mappings

// Role definitions aligned with Lokalise
enum LokaliseRole {
  Owner = "owner",
  Admin = "admin",
  Manager = "manager",
  Developer = "developer",
  Translator = "translator",
  Reviewer = "reviewer",
  Viewer = "viewer",
}

interface LokalisePermissions {
  manageTeam: boolean;
  manageProject: boolean;
  manageKeys: boolean;
  editTranslations: boolean;
  reviewTranslations: boolean;
  downloadFiles: boolean;
  uploadFiles: boolean;
  viewOnly: boolean;
}

const ROLE_PERMISSIONS: Record<LokaliseRole, LokalisePermissions> = {
  owner: {
    manageTeam: true,
    manageProject: true,
    manageKeys: true,
    editTranslations: true,
    reviewTranslations: true,
    downloadFiles: true,
    uploadFiles: true,
    viewOnly: false,
  },
  admin: {
    manageTeam: true,
    manageProject: true,
    manageKeys: true,
    editTranslations: true,
    reviewTranslations: true,
    downloadFiles: true,
    uploadFiles: true,
    viewOnly: false,
  },
  manager: {
    manageTeam: false,
    manageProject: true,
    manageKeys: true,
    editTranslations: true,
    reviewTranslations: true,
    downloadFiles: true,
    uploadFiles: true,
    viewOnly: false,
  },
  developer: {
    manageTeam: false,
    manageProject: false,
    manageKeys: true,
    editTranslations: true,
    reviewTranslations: false,
    downloadFiles: true,
    uploadFiles: true,
    viewOnly: false,
  },
  translator: {
    manageTeam: false,
    manageProject: false,
    manageKeys: false,
    editTranslations: true,
    reviewTranslations: false,
    downloadFiles: true,
    uploadFiles: false,
    viewOnly: false,
  },
  reviewer: {
    manageTeam: false,
    manageProject: false,
    manageKeys: false,
    editTranslations: false,
    reviewTranslations: true,
    downloadFiles: true,
    uploadFiles: false,
    viewOnly: false,
  },
  viewer: {
    manageTeam: false,
    manageProject: false,
    manageKeys: false,
    editTranslations: false,
    reviewTranslations: false,
    downloadFiles: true,
    uploadFiles: false,
    viewOnly: true,
  },
};

function checkPermission(
  role: LokaliseRole,
  permission: keyof LokalisePermissions
): boolean {
  return ROLE_PERMISSIONS[role][permission];
}

Step 2: Team Management

import { LokaliseApi } from "@lokalise/​node-api";

const client = new LokaliseApi({
  apiKey: process.env.LOKALISE_API_TOKEN!,
});

// List team users
async function listTeamUsers(teamId: number) {
  const users = await client.teamUsers().list({ team_id: teamId });
  return users.items.map(u => ({
    userId: u.user_id,
    email: u.email,
    fullname: u.fullname,
    role: u.role,
    createdAt: u.created_at,
  }));
}

// Add user to team
async function addTeamUser(teamId: number, email: string, role: LokaliseRole) {
  const user = await client.teamUsers().create({
    team_id: teamId,
    email,
    role,
  });

  console.log(`Added ${email} as ${role} to team ${teamId}`);
  return user;
}

// Update user role
async function updateUserRole(teamId: number, userId: number, newRole: LokaliseRole) {
  const user = await client.teamUsers().update(userId, {
    team_id: teamId,
    role: newRole,
  });

  console.log(`Updated user ${userId} to role ${newRole}`);
  return user;
}

// Remove user from team
async function removeTeamUser(teamId: number, userId: number) {
  await client.teamUsers().delete(userId, { team_id: teamId });
  console.log(`Removed user ${userId} from team ${teamId}`);
}

Step 3: Project-Level Access Control

// Add contributor to project with specific role
async function addProjectContributor(
  projectId: string,
  email: string,
  role: LokaliseRole,
  languages?: string[]  // Optional: restrict to specific languages
) {
  const params: any = {
    email,
    is_admin: role === LokaliseRole.Admin || role === LokaliseRole.Manager,
    is_reviewer: role === LokaliseRole.Reviewer,
  };

  // Language-specific access for translators
  if (languages && languages.length > 0) {
    params.languages = languages.map(lang => ({
      lang_iso: lang,
      is_writable: role === LokaliseRole.Translator,
    }));
  }

  const contributor = await client.contributors().create(projectId, params);
  console.log(`Added ${email} to project ${projectId} as ${role}`);
  return contributor;
}

// List project contributors
async function listProjectContributors(projectId: string) {
  const contributors = await client.contributors().list({
    project_id: projectId,
  });

  return contributors.items.map(c => ({
    userId: c.user_id,
    email: c.email,
    fullname: c.fullname,
    isAdmin: c.is_admin,
    isReviewer: c.is_reviewer,
    languages: c.languages,
  }));
}

Step 4: Permission Middleware

// Express middleware for permission checks
function requireLokalisePermission(permission: keyof LokalisePermissions) {
  return async (req: Request, res: Response, next: NextFunction) => {
    const user = req.user as { lokaliseRole: LokaliseRole };

    if (!checkPermission(user.lokaliseRole, permission)) {
      return res.status(403).json({
        error: "Forbidden",
        message: `Missing permission: ${permission}`,
        requiredPermission: permission,
        userRole: user.lokaliseRole,
      });
    }

    next();
  };
}

// Usage in routes
app.post("/​api/​translations/​upload",
  requireLokalisePermission("uploadFiles"),
  uploadHandler
);

app.delete("/​api/​keys/:keyId",
  requireLokalisePermission("manageKeys"),
  deleteKeyHandler
);

app.get("/​api/​translations",
  requireLokalisePermission("downloadFiles"),
  downloadHandler
);

Step 5: SSO Integration (Enterprise)

// Map IdP groups to Lokalise roles
const IDP_GROUP_MAPPING: Record<string, LokaliseRole> = {
  "Engineering": LokaliseRole.Developer,
  "Localization-Admins": LokaliseRole.Admin,
  "Translators-ES": LokaliseRole.Translator,
  "Translators-FR": LokaliseRole.Translator,
  "QA-Team": LokaliseRole.Reviewer,
  "Product": LokaliseRole.Viewer,
};

// SAML callback handler
async function handleSamlCallback(samlResponse: any) {
  const { email, groups } = parseSamlResponse(samlResponse);

  // Determine Lokalise role from IdP groups
  let role = LokaliseRole.Viewer;  // Default
  for (const group of groups) {
    if (IDP_GROUP_MAPPING[group]) {
      const mappedRole = IDP_GROUP_MAPPING[group];
      // Use highest privilege role
      if (roleHierarchy(mappedRole) > roleHierarchy(role)) {
        role = mappedRole;
      }
    }
  }

  // Provision user in Lokalise if needed
  await ensureUserExists(email, role);

  return { email, role };
}

function roleHierarchy(role: LokaliseRole): number {
  const hierarchy: Record<LokaliseRole, number> = {
    owner: 100,
    admin: 90,
    manager: 80,
    developer: 70,
    reviewer: 50,
    translator: 40,
    viewer: 10,
  };
  return hierarchy[role];
}

Output

  • Role definitions implemented
  • Team management APIs
  • Project-level access control
  • Permission middleware active

Error Handling

IssueCauseSolution
Permission deniedWrong roleCheck role assignment
SSO mismatchGroup mapping wrongUpdate IDP_GROUP_MAPPING
User not foundNot provisionedAuto-provision on first login
Language access deniedNot in languages arrayUpdate contributor languages

Examples

Quick Permission Check

// Before allowing action
if (!checkPermission(user.role, "uploadFiles")) {
  throw new ForbiddenError("You don't have permission to upload files");
}

Audit User Access

async function auditProjectAccess(projectId: string) {
  const contributors = await listProjectContributors(projectId);

  console.log(`Project ${projectId} access audit:`);
  contributors.forEach(c => {
    console.log(`  ${c.email}: ${c.isAdmin ? "Admin" : c.isReviewer ? "Reviewer" : "Contributor"}`);
    if (c.languages) {
      console.log(`    Languages: ${c.languages.map(l => l.lang_iso).join(", ")}`);
    }
  });

  return contributors;
}

Bulk Role Update

async function updateTeamRoles(
  teamId: number,
  roleUpdates: Array<{ userId: number; newRole: LokaliseRole }>
) {
  for (const update of roleUpdates) {
    await updateUserRole(teamId, update.userId, update.newRole);
    // Respect rate limits
    await new Promise(r => setTimeout(r, 200));
  }
}

Resources

Next Steps

For major migrations, see lokalise-migration-deep-dive.

More Other skills

Delegate independent tasks to specialized agents working concurrently with isolated context.

295.4K 206.3K
View

Applies Anthropic's official brand colors and typography to any sort of artifact that may benefit from having Anthropic's look-and-feel. Use it when brand colors or style guidelines, visual formatting, or company design standards apply.

179.7K 100.1K
View

Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with colors/fonts that you can apply to any artifact that has been creating, or can generate a new theme on-the-fly.

179.7K 89.5K
View

A set of resources to help me write all kinds of internal communications, using the formats that my company likes to use. Claude should use this skill whenever asked to write some sort of internal communications (status reports, leadership updates, 3P updates, company newsletters, FAQs, incident reports, project updates, etc.).

179.7K 76.1K
View

Fundamental design principles for writing maintainable, testable Python code.

40.2K 21.9K
View

Modern responsive layouts using container queries, fluid typography, CSS Grid, and mobile-first strategies.

40.2K 20K
View

Generate Playwright tests from scenarios using interactive browser exploration and validation.

39.7K 18.2K
View

Modern React state management with Redux Toolkit, Zustand, Jotai, and React Query for every state category.

40.2K 14.7K
View

GDPR-compliant data handling with consent management, data subject rights, and privacy controls.

40.2K 14.3K
View

Python error handling patterns including input validation, exception hierarchies, and partial failure handling. Use when implementing validation logic, designing exception strategies, handling batch processing failures, or building robust APIs.

40.2K 13.5K
View

Detailed multi-file refactor planning with safety checks and rollback guidance.

39.7K 13K
View