Master/Detail - Preview Overlay

This public forum is for user-to-user discussions of PHPMaker. Note that this is not support forum.
Post Reply
johnberman
User
Posts: 210

Master/Detail - Preview Overlay

Post by johnberman »

I have a master \ detail relationship setup and use

Preview Overlay to see the detail of a particuar record

I have now added security and it works fine, I can see detail added by anyone but only edit\delete my own

So on my main page - meteor_eventslist.php

If I hover of the detail button i can see all the details for an event no matter who added them - thats fine

All of the detail lines have a dropdown associated with them with the Edit \ Delete Option - even if I did not add them - it wont let me actually edit\delete a detail thats not mine - so thats correct

If I go directly to event_commentslist.php again I see all the detail but only the edit \ delete option against the details I added - so thats correct

So I want to remove the edit\delete option from the preview overlay view for those records that that use has no rights to

Hope this makes sense - its hard to explain

Regards
John Berman


mobhar
User
Posts: 11717

Post by mobhar »

You may simply use "ListOptions_Rendered" server event under the following locations: "Server Events" -> "Table-Specific" -> "Preview Page" that belongs to your detail table, for example, if the value of "MyUserID" field is not equal to CurrentUserID(), hide "edit" and "delete" link/button:

if ( $this->MyUserID->CurrentValue != CurrentUserID() ) { // <--- adjust to your needs
$this->ListOptions->Items["edit"]->Body = "";
$this->ListOptions->Items["delete"]->Body = "";
}


Post Reply