FrappePermissionController class

Frappe Permission Controller with extended methods & properties

Includes a method for loading basic permissions and checking permission of doctypes/documents.

Inheritance

Properties

basicPerms BasicPermInfo?
Holds the basic permissions defined by BasicPermInfo.
getter/setter pairinherited
config RenovationConfig
finalinherited
doctypePerms Map<String?, List<DocPerm>>
Holds the permissions for each doctype as a form of caching.
getter/setter pairinherited
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

canAmend(String doctype) Future<bool>
Check if the user can amend a doctype.
inherited
canCancel(String doctype) Future<bool>
Check if the user can cancel a doctype.
inherited
canCreate(String doctype) Future<bool>
Check if the user can create a doctype.
inherited
canDelete(String doctype) Future<bool>
Check if the user can delete a doctype.
inherited
canEmail(String doctype) Future<bool>
Check if the user can email a doctype.
inherited
canExport(String doctype) Future<bool>
Check if the user can export a doctype.
inherited
canGetReport(String doctype) Future<bool>
Check if the user can get report of a doctype.
inherited
canImport(String doctype) Future<bool>
Check if the user can import a doctype.
inherited
canPrint(String doctype) Future<bool>
Check if the user can print a doctype.
inherited
canRead(String doctype) Future<bool>
Check if the user can read a doctype.
inherited
canRecursiveDelete(String doctype) Future<bool>
Check if the user can recursively delete a doctype.
inherited
canSearch(String doctype) Future<bool>
Check if the user can search a doctype.
inherited
canSetUserPermissions(String doctype) Future<bool>
Check if the user can set user permissions of a doctype.
inherited
canSubmit(String doctype) Future<bool>
Check if the user can submit a doctype.
inherited
canWrite(String doctype) Future<bool>
Check if the user can write a doctype
inherited
clearCache() → void
Resets the basicPerms and doctypePerms properties.
inherited
getCore() Renovation
Gets the reference to the Renovation instance
inherited
getHostUrl() String
Returns the configured host URL towards the backend
inherited
getPerm<T extends FrappeDocument>({required String? doctype, T? document}) Future<RequestResponse<List<DocPerm>>>
Returns the list permission of the current user of a certain doctype.
override
handleError(String errorId, ErrorDetail? error) → ErrorDetail
Returns the ErrorDetail after manipulating an existing one.
hasPerm({required String? doctype, required PermissionType pType, int? permLevel, String? docname}) Future<bool>
Returns boolean whether the user has perm pType for a particular doctype.
override
hasPerms({required String doctype, required List<PermissionType> pTypes, String? docname}) Future<bool>
Similar to hasPerm with the key difference that it can accept a list of perms pTypes.
override
loadBasicPerms() Future<RequestResponse<BasicPermInfo?>>
Returns the basic params from the backend for the current user defined by BasicPermInfo.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited