I have an app 'app_name' which has a profile object which is linked to User object via OneToOne field way. Now on login I redirect the user to a edit profile page on admin site using url using his profile object id. I've granted as expected is_staff access and permission to edit profiles.
Now I wan't to prevent him from accessing other profile objects. I've got two ways, as of now, which I can think so- 1. Make a custom permission which grants access to edit for his profile only who logins. 2. Blocking urls which doesn't involves profile object id.
Superuser should be able to access normally as it is available as default.
I've no idea how can I execute one of the ways. Any other possible ways are too welcomed. Please help!