erpnext-errors-permissions

Implement secure ERPNext/Frappe permission checks with standardized error patterns.

163|53|Updated Jan 14, 2026
One-click install
npx skills add https://github.com/OpenAEC-Foundation/ERPNext_Anthropic_Claude_Development_Skill_Package --skill erpnext-errors-permissions
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: erpnext-errors-permissions
Source: https://github.com/OpenAEC-Foundation/ERPNext_Anthropic_Claude_Development_Skill_Package/tree/main/skills/source/errors/erpnext-errors-permissions
Command: npx skills add https://github.com/OpenAEC-Foundation/ERPNext_Anthropic_Claude_Development_Skill_Package --skill erpnext-errors-permissions

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

ERPNext/Frappe permission handling can be error-prone and lead to silent failures or security gaps. This Skill provides structured, battle-tested patterns for safe permission checks, error handling, and audit logging across ERPNext modules.

Core Features & Use Cases

  • Comprehensive has_permission hook patterns that never grant access, only deny or defer.
  • Safe permission_query_conditions with robust try/except and safe fallbacks.
  • API endpoints and client/server error handling patterns with consistent messaging and auditing.
  • Security-first logging of denial events and audit trails.

Quick Start

Use the erpnext-errors-permissions skill to implement secure permission checks in your ERPNext app.

Frequently Asked Questions about erpnext-errors-permissions

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I implement secure has_permission hooks in ERPNext?

Secure has_permission hooks in ERPNext require standardized patterns that return None to deny or defer access, ensuring they never accidentally grant permission. This Skill provides battle-tested hook implementations with robust error handling and safe fallbacks for production reliability.

What is the best way to handle permission_query_conditions safely in Frappe?

Safe permission_query_conditions in Frappe require wrapping database queries in try/except blocks with SQL escaping and safe fallbacks. This approach prevents silent failures and security gaps while maintaining consistent query filtering across ERPNext modules.

Why does my ERPNext permission check fail silently without raising a PermissionError?

Silent permission failures in ERPNext occur when has_permission hooks lack proper try/except wrapping or return inconsistent values. Using consistent PermissionError usage and standardized error patterns ensures failures are caught, logged, and surfaced correctly.

Can I use these permission error handling patterns across all ERPNext modules?

Yes, these permission error handling patterns apply to document-level and API permission checks across all ERPNext modules. They provide consistent messaging, security-first auditing, and denial event logging for comprehensive coverage.

How do I add audit logging to Frappe permission denial events?

Audit logging for Frappe permission denial events requires security-first logging patterns that capture denial actions and create audit trails. This Skill implements structured logging alongside standardized permission checks to ensure production reliability and traceability.