modifiedcontent Posted December 19, 2021 Share Posted December 19, 2021 I want to give members of my site access to their profile page edit in admin, but I don't want them to go up the tree and start editing other members pages - which is what could happen if I control access by the template 'profile' only. How can I make sure members can only edit their own profile page? In the profile template, for the front end, I have something like `if ( $user->isLoggedin() && $user->name == $page->name )` to restrict edit access to the page owner. In the back end there are parameters on the URL, like admin/page/edit/?id=1388 How can I target that? I can get the currently logged-in user's profile page ID; if they are trying to edit another page ID, they should be blocked/redirected. Can I add something in admin.php to achieve that? I see Ryan Cramer has a PageEditPerUser module, but it is very old, very beta and requires to enter allowed pages manually. AdminRestrictBranch seems more stable and has a Custom PHP option - trying to figure that out now... Link to comment Share on other sites More sharing options...
Jan Romero Posted December 19, 2021 Share Posted December 19, 2021 Hi. Sorry about the short reply, but does the Permission “profil-edit” not do what you need out of the box? 1 Link to comment Share on other sites More sharing options...
modifiedcontent Posted December 20, 2021 Author Share Posted December 20, 2021 Thanks for the response @Jan Romero. I was looking in that direction. I think 'profile-edit' is for admin/profile/, which is based on the system 'user' template. I use another 'profile' template for pages created when members register with the site. Today I have tried to figure out if I could replace that 'profile' template by the 'user' template, but I can't make it work for some reason. I can just keep using 'profile' I guess and get all the content from 'user' anyway, but is there any way to edit the template of /admin/profile/? The use of the (user)name instead of First Lastname annoys me. And I'd like to replace the Processwire logo/icon with the site + homelink etc. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now