Where I can find the code for the permission in case need to change or fix bug

Hello;

Can I know where the code that is responsible for handling the permission is existed? Because maybe there is a bug that need to be fixed or there I need to do customization.

Is it existed in frappe or I can find it in erpnext?

Appreciate the kindly help and advise.
Regards
Bilal

Hi Bilal,

With console access to the server, try a code search like this:

frappe@ubuntu:~/frappe-bench$ find . -name '*.py' | xargs grep 'permission'

The above expression reports all the Python files that contain ‘permission’.

To view the files, use Unix less or an editor, or from a web browser view the files on github.com

More search examples here Where do I go to setup Backups in new v8

Thank you @clarkej

Why to search only in .py files?
Let us think in this way: a link field that is going to display the values based on the allowed permission, it is not a javascript? I am thinking that displaying the values based on the allowed permission should be same as displaying the values based on the filter which depends on the get_query. What do you think?

Regards
Bilal

Yes Javascript source code has a .js file extension, hence this works

frappe@ubuntu:~/frappe-bench$ find . -name '*.js' | xargs grep 'permission'

frappe@ubuntu:~/frappe-bench$ find . -name '*.js' | xargs grep get_query