Editing Restrictions

Reject unavailable actions before persistence and explain how the user can proceed.

Application-owned policies

The following example demonstrates three independent policies. The December 2, 09:00 Account review is protected by its stable ID. Other appointments can be edited between 08:00 and 18:00 UTC, provided they do not overlap another appointment.

UTC

2026-12-02 – 2026-12-02

Wed, Dec 2

All day
08:0009:0010:0011:0012:0013:0014:0015:0016:0017:00

No changes saved · Requests: 0

      readonly policy: NgbSchedulerEditPolicy = request => {
  const id = request.original?.id ?? request.event.id;
  if (request.kind !== 'create' && this.protectedIds.has(id)) {
    return 'This appointment is read-only.';
  }
  return null; // Add application booking-window/capacity checks here.
};
// <ngb-scheduler [editPolicy]="policy" [mutationHandler]="persist" ... />
// Repeat authorization and conflict checks in your persistence service.
    

When checks run

editPolicy returns a reason to reject an action, or null to allow it. Built-in and custom dialogs check on opening and again before submission. External forms run the same policy when they submit. Move, resize and resource drafts run the same policy when you choose Apply change. A rejection preserves the draft and sends no persistence request.

Use stable IDs and the original snapshot for protected appointments. Deletion is checked against the confirmed original, not edited draft fields. Date validation, duplicate-ID checks and stale-original checks run independently of application policy.

Server authority

This example checks only loaded events in one shared calendar. A production service must enforce permissions, capacity and conflicts against all relevant records, including concurrent changes. Client checks improve feedback; they are not authorization. An already-sent request cannot be rolled back by changing a checkbox.

Business-hour shading does not restrict bookings. Default and custom editors use UTC time fields. Drag an event or choose Move or resize to try the same restrictions. Resource-aware capacity and recurrence policies remain application responsibilities.