619
620
return this.setProperty("name", aValue);
623
// readonly attribute calICalendarACLManager aclManager;
625
const defaultACLProviderClass = "@mozilla.org/calendar/acl-manager;1?type=default";
626
let providerClass = this.getProperty("aclManagerClass");
627
if (!providerClass || !Components.classes[providerClass]) {
628
providerClass = defaultACLProviderClass;
630
return Components.classes[providerClass].getService(Components.interfaces.calICalendarACLManager);
633
// readonly attribute calICalendarACLEntry aclEntry;
635
return this.mACLEntry;
622
638
// attribute calICalendar superCalendar;
623
639
get superCalendar() {
624
640
// If we have a superCalendar, check this calendar for a superCalendar.
834
850
// calISchedulingSupport: Implementation corresponding to our iTIP/iMIP support
835
851
isInvitation: function cPB_isInvitation(aItem) {
836
let id = this.getProperty("organizerId");
838
let org = aItem.organizer;
839
if (!org || (org.id.toLowerCase() == id.toLowerCase())) {
842
return (aItem.getAttendeeById(id) != null);
852
if (!this.mACLEntry || !this.mACLEntry.hasAccessControl) {
853
// No ACL support - fallback to the old method
854
let id = this.getProperty("organizerId");
856
let org = aItem.organizer;
857
if (!org || (org.id.toLowerCase() == id.toLowerCase())) {
860
return (aItem.getAttendeeById(id) != null);
865
let org = aItem.organizer;
868
// if we don't have an organizer, this is perhaps because it's an exception
869
// to a recurring event. We check the parent item.
870
if (aItem.parentItem) {
871
org = aItem.parentItem.organizer;
872
if (!org) return false;
879
// - the organizer of the event is NOT within the owner's identities of this calendar
880
// - if the one of the owner's identities of this calendar is in the attendees
881
let ownerIdentities = this.mACLEntry.getOwnerIdentities({});
882
for (let i = 0; i < ownerIdentities.length; i++) {
883
let identity = "mailto:" + ownerIdentities[i].email.toLowerCase();
884
if (org.id.toLowerCase() == identity)
887
if (aItem.getAttendeeById(identity) != null)
847
894
getInvitedAttendee: function cPB_getInvitedAttendee(aItem) {
848
895
let id = this.getProperty("organizerId");
849
return (id ? aItem.getAttendeeById(id) : null);
896
let attendee = (id ? aItem.getAttendeeById(id) : null);
898
if (!attendee && this.mACLEntry && this.mACLEntry.hasAccessControl) {
899
let ownerIdentities = this.mACLEntry.getOwnerIdentities({});
900
if (ownerIdentities.length > 0) {
902
for (let i = 0; !attendee && i < ownerIdentities.length; i++) {
903
identity = "mailto:" + ownerIdentities[i].email.toLowerCase();
904
attendee = aItem.getAttendeeById(identity);
852
912
canNotify: function cPB_canNotify(aMethod, aItem) {