This is a migrated thread and some comments may be shown as answers.

Security trim for RAD Schedule

1 Answer 42 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
CH
Top achievements
Rank 1
CH asked on 14 Oct 2011, 03:34 AM
Hi,
is there anyway or documentation to shows me how to set security trim on RADSchedule.
I have a requirement where only admin can update,delete and create new appointment,
Contract Staff can only view
Permanent staff can view, create and delete their own appointment.

can someone point me to any website/document so i can learn how to do this.

thanks.

Regards,
CH

1 Answer, 1 is accepted

Sort by
0
Stuart Hemming
Top achievements
Rank 2
answered on 14 Oct 2011, 07:58 AM
Hi there,

We do something very similar to this. I assume that, server-side, you have a way of knowing the access level of the user.

What you need to do, in the Appointment_DataBound event of the Scheduler, is set the AllowDelete and AllowEdit properties appropriately, like this ...
protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
{
  e.Appointment.AllowEdit = e.Appointment.AllowDelete = UserHasEditAccessLevel;
}

When it comes to adding a new appointment, it depends on how you normally allow a user to do it. The normal method is for the user to double-click on an empty time slot. You can catch this and stop it if necessary by wiring up the OnFormCreating event ...
protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
{
  e.Cancel = !UserHasAddAccessLevel;
}

You can find more information about RadScheduler's events starting at this documentation page. Similarly, you'll find a number of helpful ideas if you look at the code associated with the various RadScheduler demos.

Hope this helps get you started.

-- 
Stuart


Tags
Scheduler
Asked by
CH
Top achievements
Rank 1
Answers by
Stuart Hemming
Top achievements
Rank 2
Share this question
or