If you are using the DayPilot modal dialog:
1. You need to secure the "edit" page itself - this is required because DayPilot settings can be circumvented (they are client-side only).
2. Depending on the permissions and event properties, you can disable EventClick using BeforeEventRender:
protected void DayPilotMonth1_BeforeEventRender(object sender, BeforeEventRenderEventArgs e)
{
if ((string)e.DataItem["owner"] == User.Identity.Name) // "owner" field must be available in the DataSource
{
e.ClickEnabled = false;
}
}
3. Another option is to display a different page for non-owners:
<DayPilot:DayPilotMonth
...
DataTagFields="owner"
EventClickHandling="JavaScript"
EventClickJavaScript="onClick(e)"
/>
<script>
function onClick(e) {
if (e.tag("owner") === loggedInUser) {
// open edit dialog
}
else {
// show warning...
}
}
</script>
Make sure the owner field is available (DataTagFields) and check the value in the event click handler (EventClickJavaScript).