Understanding Frappe's Role-Based Permission System

ERPNext & Frappe Development

19 August, 2026

frappe-role-based-permissions
Jaymin Lakhmanbhai Tarpara

Jaymin Lakhmanbhai Tarpara

Sr Developer, Softices

When a business introduces an ERP system, two questions quickly become important: what data should the system store, and who should be allowed to access it?

In Frappe and ERPNext, DocTypes answer the first question. The permission system answers the second.

DocType defines the fields, relationships, and behavior of a business record. But defining a record is only half the job. You also need to control who can view, create, edit, submit, cancel, or otherwise interact with it.

Frappe's permission system is designed around Users, Roles, DocTypes, Permission Levels, and User Permissions. These layers can work together to handle everything from simple department-based access to more granular restrictions based on ownership, company, warehouse, territory, or other linked values.

Understanding how these pieces fit together is important whether you're configuring ERPNext, customizing an existing implementation, or building a custom Frappe application.

What is Role-Based Permission in Frappe?

Frappe does not normally define permissions separately for every individual user. Instead, permissions are assigned to Roles, and users receive one or more roles.

For example, a user could have:

  • Sales User → access to create and read sales records
  • Sales Manager → broader access to sales records
  • HR Manager → access to employee and HR information
  • Accounts User → access to accounting transactions

A user can have multiple roles, and their access is determined by the permissions associated with those roles.

This approach makes permission management easier to maintain. Instead of configuring access for every employee individually, an administrator can define what a particular job function is allowed to do and then assign that role to the appropriate users.

When responsibilities change, updating a user's roles can change their access without rebuilding the entire permission structure.

The Building Blocks of Frappe Permissions

At the center of the Frappe system are three concepts: Role, DocType, and Permission Level.

Together they define exactly what a role can do with a given type of record.

Role

DocType

Permission Level

What It Controls

Sales User Lead 0 Read, Create
Sales Manager Lead 0 Read, Write, Create, Delete
HR Manager Employee 0 Read, Write, Create
Accounts User Sales Invoice 0 Read, Write, Submit
Accounts Manager Sales Invoice 0 Read, Write, Submit, Cancel, Amend


Role

A Role represents a set of responsibilities or access rights. Roles are assigned to users and determine what actions those users can perform on different DocTypes.

DocType

A DocType represents a business object or record, such as Employee, Customer, Lead, Sales Invoice, or Stock Entry.

Permissions can be configured for each DocType and role combination.

Permission Level

A Permission Level, or permlevel, allows access to be separated within the same document. Most fields use level 0 by default, while sensitive fields can be assigned a higher level and restricted to specific roles.

What Actions Can Frappe Permissions Control?

Frappe provides permissions for more than simply viewing or editing records.

Common permission types include:

  • Read → View records
  • Write → Edit existing records
  • Create → Create new records
  • Delete → Delete records
  • Submit → Submit a document
  • Cancel → Cancel a submitted document
  • Amend → Create an amended version of a cancelled document
  • Print → Print or generate PDFs
  • Email → Send a document by email
  • Report → Access report views
  • Import → Import records using the Data Import Tool
  • Export → Export records
  • Share → Share a document with another user
  • Set User Permissions → Allow users with the relevant permission to configure User Permissions for others

These permissions can be combined differently for each role and DocType.

For example, a Sales User might be allowed to create and read Leads but not delete them, while a Sales Manager could have additional write and delete permissions.

Permission Levels: Controlling Fields Within a Document

Role permissions generally determine what a user can do with a document. 

Permission Levels provide another layer by controlling access to individual fields within that document. This is useful when different roles need different visibility inside the same record.

Consider an Employee record containing:

  • Employee Name
  • Department
  • Designation
  • Reporting Manager
  • Salary
  • Salary Structure

You may want HR staff to access general employee information while restricting salary-related fields to HR Managers.

Instead of creating separate Employee DocTypes, sensitive fields can be assigned a different permission level and access to that level can be granted only to specific roles.

This is particularly useful when different teams work with the same business record but should not have identical visibility.

User Permissions: Restricting Which Records a User Can Access

Role permissions answer a question such as:

| Can this role access the Sales Invoice DocType?

But businesses often need to ask a more specific question:

| Which Sales Invoices can this particular user access?

That's where User Permissions come in.

User Permissions can restrict records based on values in Link fields. For example, a company might have several warehouses, but a warehouse manager should only work with records associated with their assigned warehouse.

Instead of creating a separate role for every warehouse, you can use:

  • Role: Warehouse Manager
  • User Permission: Warehouse = Mumbai Warehouse

This creates a distinction between broad role-based access and record-level filtering.

Role Permission

User Permission

Applies to DocType and actions Specific linked values
Configured per Rules Individual users
Example Can Sales User read Sales Invoice? Can this user access invoices for a specific Territory?
Purpose Define job-based access Restrict which records the user can access


This distinction becomes especially useful in organizations with multiple companies, branches, warehouses, territories, or cost centers.

Ownership and Conditional Permissions

Frappe also supports more specific permission scenarios.

For example, a role's permission can be configured with an "If the user is owner" restriction. This allows access rules to depend on whether the current user owns the document.

For more dynamic requirements, Frappe provides Permission Query Conditions and related server-side customization options.

For example:

  • Sales representatives can access only records assigned to them.
  • Department heads can access records belonging to their department.
  • A custom application can restrict records according to a business-specific condition.
  • A list query can be modified to apply additional permission conditions.

Frappe provides a permission_query_conditions hook for developers who need to add custom query-level restrictions.

This is an area where developer involvement is usually appropriate. Custom permission logic should be carefully tested because an incorrect condition can either expose data or prevent legitimate users from accessing it.

How These Permission Layers Work Together

One of the easiest ways to understand Frappe permissions is to think of them as progressively narrowing access.

For example:

User → Roles → DocType permissions → Permission Levels → User Permissions / ownership restrictions → Custom permission conditions

A user might therefore have permission to read the Sales Invoice DocType because of their role, but User Permissions could restrict them to invoices associated with a particular company or territory.

Frappe's permission-aware query mechanisms can apply role permissions, User Permissions, sharing, ownership restrictions, permission query conditions, and field-level security when permissions are enforced.

This layered approach is what makes the permission system flexible enough for both standard ERP workflows and more complex custom applications.

Common ERPNext Permission Scenarios

A few patterns show up repeatedly across ERPNext implementations:

Sales

Sales Users can create and read Leads and Opportunities but may not have permission to delete records.

Sales Managers can receive additional write, delete, or reporting permissions.

Human Resources

HR staff can access employee records, while salary-related fields or financial HR documents can be restricted to authorized roles using permission levels.

Finance

Accounts Users can create and submit financial transactions, while cancellation or amendment rights can be limited to Accounts Managers.

This creates a separation between entering transactions and making corrections to finalized records.

Multi-Warehouse Operations

Warehouse users can have access to inventory-related DocTypes while User Permissions restrict them to their assigned warehouse.

This avoids creating dozens of nearly identical roles simply to represent different locations.

Vendor or Customer Portals

Portal users can be given access to relevant records while additional restrictions determine which records they can view. Frappe also supports roles for Website Users and portal-specific menu access.

Best Practices for Managing Permissions in ERPNext and Frappe

1. Design Roles Around Responsibilities

Create roles based on what people need to do rather than creating a new role for every individual employee or location.

2. Use User Permissions for Record-Level Restrictions

If two users perform the same job but should see different records, User Permissions are often more appropriate than creating separate roles.

3. Avoid Giving Excessive Administrative Access

High-level administrative roles should be limited to users who genuinely need them. Broad permissions make mistakes and unintended data access harder to prevent.

4. Keep Sensitive Fields at Appropriate Permission Levels

If a document contains financial, salary, or other restricted information, consider whether everyone who can access the document should also be able to access every field.

5. Test Permissions Before Deployment

Don't assume that a permission configuration works simply because the Role Permissions Manager looks correct. Test the actual experience with representative user accounts and verify what users can see, create, edit, submit, export, and delete.

6. Review Permissions After Customization

New DocTypes, workflows, integrations, and custom scripts can introduce new access requirements. Permission design should therefore be part of the customization process rather than something addressed only after development is complete.

Why Permissions Matter in Custom Frappe Applications

The value of Frappe's permission system extends beyond ERPNext.

Whether you're implementing ERPNext for the first time, migrating from a legacy system, or building a custom application, the same underlying concepts of users, roles, DocTypes, permission levels, User Permissions, and custom permission conditions apply.

That makes the framework suitable for applications such as:

  • Employee portals
  • Vendor management systems
  • Helpdesk applications
  • Field-service platforms
  • Internal workflow systems
  • Industry-specific business applications

The important part is to design the access model alongside the application itself.

A system may work perfectly from a functional perspective and still create problems if users can access records they shouldn't, edit finalized information, or view sensitive fields. Defining who can access what, at which level, and under which conditions before development begins can prevent significant rework later.

Designing Frappe Permissions That Scale

Frappe's permission system provides the flexibility to control access at multiple levels. Roles define what users can do, Permission Levels can restrict individual fields, User Permissions can narrow access to specific records, and custom conditions can handle more dynamic requirements.

The key is choosing the right layer for each requirement and keeping the permission model aligned with the way your organization actually works. A thoughtful approach from the beginning can help prevent data exposure, reduce unnecessary access, and avoid costly permission changes later.

For businesses extending ERPNext or building custom Frappe applications, Softices can help translate these access requirements into a practical permission structure that fits the application's workflows and organizational needs.


Django

Previous

Django

Next

ERPNext API Integrations: Connecting ERP with E-commerce, Payments & CRMs

erpnext-api-integrations

Frequently Asked Questions (FAQs)

Frappe assigns permissions to roles rather than individual users. Users inherit access based on the roles assigned to them, including permissions such as Read, Write, Create, Delete, Submit, and Cancel.

Role Permissions control what an entire role can do with a DocType. For example, whether Sales Users can create Leads. User Permissions go a level deeper, restricting an individual user to specific linked records, such as only their own Territory or Warehouse, regardless of what their role generally allows.

Yes. Frappe supports field-level permissions through Permission Levels, allowing you to hide or lock individual fields such as salary information from roles that shouldn't see them, without needing separate forms or DocTypes.

Custom Frappe applications can use the same permission framework as ERPNext, including Roles, DocType permissions, Permission Levels, User Permissions, and custom permission conditions. Designing these rules early helps maintain secure and manageable access as the application grows.

Assign a User Permission that links the user to a specific value, such as a Warehouse, Territory, or Cost Center. Frappe will automatically filter every relevant DocType down to records matching that value for that user.

Standard Role and User Permissions can be configured directly through the ERPNext interface by an administrator, no coding required. More advanced conditional permissions, built with Server Scripts, typically do require developer involvement.

Yes. Roles, DocTypes, and permission rules are core to the Frappe Framework itself, not specific to ERPNext. Any custom application built on Frappe like a portal, helpdesk, or industry-specific tool uses the same permission engine, which is part of what makes Frappe such a flexible foundation for custom development.