How 'only if creator' works in roles and permission manager

I want to know, on what field of a doctype frappe is able to check if the logged in user is the creator of the record or not

My usecase is that I made a web page and when user submits the web page a new user and a record in ‘NHCP Users’ are created and the value of owner field for each record is ‘guest’ and because of this, after the user login and go to ‘NHCP Users’ doctype then the user is able to see all the users even though i gave ‘only if creator’ for the role and the user doctype in role permission manager

so i want to register users using a web page so for every doctype record created it will be guest user who created the record but when the user logs in and view the records of the doctype, only those records which are created by the user should be displayed
how can I do it

Hi,

To solve your issue, you can update the “owner” field at the time of first login.

You can get the logged user using frappe.session_user and update the owner field in NHCP User doctype for corresponding user.

Thanks,

Divyesh Mangroliya

Hi @mangroliya,
I am updating the owner field when user is registering but still when User goes to ‘NHCP Users’ doctype all the records are visible to the user instead of user own records
Do you know how ‘Only If Creator’ works in roles and permissions?