Organization access control
When you set up your PlanetScale account, you’re asked to create an Organization. An organization is essentially a container for your databases, settings, and members. You can create multiple organizations in the same account for different applications or use cases. Within each organization, you can add members and assign them different roles. This document covers the different roles, the ways you can assign roles, permissions associated with those roles.Roles and permissions
We currently support four predefined roles in your organization:Organization AdministratorOrganization AnalystOrganization MemberDatabase Administrator
Organization Administrator
AnOrganization Administrator can perform all actions in an organization, as well as all actions on every database within that organization.
Organization Administrators can also require multi-factor authentication for every member of the organization.
Organization Analyst
AnOrganization Analyst can perform read-only operations on production database branches. This role is designed for team members who need to view production data for analysis and reporting without full administrative access. Analysts can create and manage read-only credentials for production branches.
Organization Member
AnOrganization Member can only perform limited actions within an organization and on all databases in that organization. By default, all users added to an organization have this role.
Database Administrator
ADatabase Administrator can perform all actions on the database for which they were assigned the Databases Administrator role.
This role is assigned at the database level and gives elevated permissions for the particular database that an organization member is the Database Administrator of. If you want to grant a member full access to manage one or several databases but not full Organization Administrator access, then this is the role you want. Please note, a user that is granted this role must be a member of the organization of which the database exists in, so they will have the permissions associated with Organization Member as well.
Custom roles
Organization Administrators can create custom roles and assign them to members instead of a predefined role. Each organization member has one organization role. Only Organization Administrators can create, edit, and delete custom roles. Every custom role includes View organization. Custom roles cannot include permission to manage custom roles.Custom role slugs
PlanetScale generates a slug from the role name when you create the role. The slug does not change if you rename the role. On the custom roles page, open the role’s overflow menu and click Copy slug. Use the slug to assign the role through the API or your identity provider. Therole field accepts a predefined name (admin, member, or analyst) or a custom role slug.
Create a custom role
1
In the PlanetScale dashboard, click on the Settings tab in the top navigation.
2
Click on Members in the sidebar on the left, then open the Custom roles tab.
3
Click Create custom role.
4
Enter a role name, an optional description, and the permissions to include. Then click Create role.
Assign a custom role
Assign a custom role from the Role menu on the Members page, or when you invite someone. Organization Administrators can assign any role. You cannot change or revoke access for a user with more permissions than you. To assign a custom role through the API, setrole on update membership or create invitation to the custom role slug. To assign a custom role from an identity provider, see SSO.
Organization-level permissions
Each role has a set of permissions assigned to it, which determines what actions that role is allowed to take within an organization or database. The following table describes permissions assigned at the organization level forOrganization Administrators, Organization Analysts, and Organization Members. Because Database Administrators don’t have any organization-level permissions, they are not included in this table.
Database-level permissions
The following table describes the permissions assigned at the database level forOrganization Administrators, Organization Analysts, Organization Members, and Database Administrators.
For Organization Administrators, Organization Analysts, and Organization Members, these permissions apply to every database in the organization. Because the Database Administrator role is assigned at the database level, the permissions are for the specific database(s) for which they have the Database Administrator role.
An organization may have several databases, and an
Organization Member may have different access to each database depending on whether or not they also have the Database Administrator role.
Assign organization roles to members
You can follow the steps below to assign roles to your members, including custom roles.- In the PlanetScale dashboard, click on the Settings tab in the top navigation.
- Click on “Members” in the sidebar on the left.
- From here, you can click on the dropdown on the right under the “Role” column to select the role you want to apply to each member.
Organization Member by default.
You cannot change or revoke access for a user with more permissions than you.
Member role management is issued at the organization level. Each organization in your account may have different
members with different access levels.
Assign roles at a database level
There are two ways to assign database-level roles to Organization members:- Individually using the
Database Administratorrole. - Creating a Team, adding member(s), and adding database(s) to that team.
Individually assign the Database Administrator role
To assign a member the role of Database Administrator, follow the steps outlined below. You must be an Organization Administrator or an existing Database Administrator to manage the Database Administrator role.
Members that create a database are automatically assigned the role of
Database Administrator for that database.1
In the PlanetScale dashboard, click on the name of the database you want to add a Database Administrator to.
2
Click on the “Settings” tab in the top navigation.
3
Click on “Administrators” in the sidebar on the left.
4
To add an administrator, click on the “Add administrator” button and select the member you wish to add as a Database Administrator.
5
From here, you can also remove a Database Administrator by clicking the “Remove” button next to their name.
Add Database Administrator role via Teams
If you wish to give several members the Database Administrator role, you may want to create a Team. This will allow you to manage the access to that database all in one place. For instructions, see our Teams documentation.Revoke member tokens
Organization Administrators can revoke a member’s pscale CLI logins and the OAuth applications they authorized without removing them from the organization, for example if the member loses a device.1
In the PlanetScale dashboard, click on the “Settings” tab in the top navigation, then click on “Members” in the sidebar on the left.
2
Open the actions menu at the end of the member’s row and click “Revoke tokens”.
3
Select the checkbox to confirm that the member will need to sign in to the CLI and reapprove applications, then click “Revoke tokens”.
pscale auth login and reapproves the applications. The action is recorded in the organization’s audit log.
Revoking a member’s tokens doesn’t sign them out of their browser sessions and doesn’t affect the organization’s service tokens. To remove a member’s access entirely, remove them from the organization.
You can’t revoke your own tokens from the members list. To revoke your own CLI logins and applications, revoke all sessions from your account settings instead. That revokes them for every organization and signs you out of your other browsers.

