Bugfix delegation (#585)
Co-authored-by: Camille Moussu <cmoussu@linagora.com>
This commit is contained in:
@@ -56,6 +56,7 @@ describe("Event Full Display — delegated calendar move", () => {
|
|||||||
name: "Delegated Calendar",
|
name: "Delegated Calendar",
|
||||||
color: "#00FF00",
|
color: "#00FF00",
|
||||||
delegated: true,
|
delegated: true,
|
||||||
|
access: { write: true },
|
||||||
owner: {
|
owner: {
|
||||||
emails: ["delegate@test.com"],
|
emails: ["delegate@test.com"],
|
||||||
name: "Delegate User",
|
name: "Delegate User",
|
||||||
|
|||||||
@@ -76,13 +76,12 @@ function EventUpdateModal({
|
|||||||
|
|
||||||
const user = useAppSelector((state) => state.user);
|
const user = useAppSelector((state) => state.user);
|
||||||
|
|
||||||
// if the event's calendar is delegated then it shall be the only calendar accessible from the event update modal
|
|
||||||
const userPersonalCalendars: Calendar[] = useMemo(() => {
|
const userPersonalCalendars: Calendar[] = useMemo(() => {
|
||||||
const allCalendars = Object.values(calList) as Calendar[];
|
const allCalendars = Object.values(calList) as Calendar[];
|
||||||
return allCalendars.filter(
|
return allCalendars.filter(
|
||||||
(calendar: Calendar) =>
|
(calendar: Calendar) =>
|
||||||
calendar.id?.split("/")[0] === user.userData?.openpaasId ||
|
calendar.id?.split("/")[0] === user.userData?.openpaasId ||
|
||||||
calendar.delegated
|
(calendar.delegated && calendar.access?.write)
|
||||||
);
|
);
|
||||||
}, [calList, user.userData?.openpaasId]);
|
}, [calList, user.userData?.openpaasId]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user