Permission By Field

Is it possible to give doctype permission by field

Example:
Consider a Doctype with a field Reviewer.
If I create this form and select a user in the Reviewer, I want the document permission visible only to the Reviewer whom I selected in the doc and Owner (which is myself).

1 Like

Hello,

Please refer
Managing Perm Level in Permission Manager?
Once you set field level permission, under role permission you can set
Apply User Permissions and Select Document Types.

Hope this helps.

1 Like

Hi,

Okay… I am not looking to set permission to a specific field.
I am looking to set permission to a doctype, based on the field value.

Let’s take the Leave Application itself,
Consider we have an doctype leave application which contains the field, approver.
Now Lets say we have 5 Leave Approvers and I can choose any one while filling up the form.

Once I select an approver. This Leave Application which I am going to submit must be visible only to the approver whom I selected.

This Application Should not be visible to other approvers.
If I set Doctype permissions to the Role Approver, all of the approvers are able to view the form. But I want is that only the approver whom I select in the form should be able have read write access. How do I achieve this. ?

1 Like

Have you found a solution to this?

Hello @Joses_Paul This feature is not available out of the box yet. You can keep the doctype Leave application accessible to the users but if you want only 1 user to be allowed, then make the other users to have only Read-only access and not edit permissions.

@Yousef @Joses_Paul @Mitali_Deshpande @grh

I think this can help :

1 Like

I’m looking into at at the moment, writing a custom code on the server
I hope it works

1 Like

@Yousef @Joses_Paul

Have you find any solution to this?
even I need something like this.

Tried custom logic through doctype permissions hook ?

https://frappe.io/docs/user/en/guides/basics/hooks

With all the improvements in ERPNext, there should be a straightforward way to handle this scenario by now… Even if it’s a whitelisted method that can be called from the client side

Kind regards,