mirror of
https://github.com/inverse-inc/sogo.git
synced 2026-07-18 22:54:55 +00:00
(fix #157) we now honor which calendars we can write to
This commit is contained in:
@@ -86,9 +86,10 @@
|
||||
* @memberof Calendar
|
||||
* @desc Set or get the list of calendars. Will instanciate a new Calendar object for each item.
|
||||
* @param {object[]} [data] - the metadata of the calendars
|
||||
* @param {bool} [writable] - if true, returns only the list of writable calendars
|
||||
* @returns the list of calendars
|
||||
*/
|
||||
Calendar.$findAll = function(data) {
|
||||
Calendar.$findAll = function(data, writable) {
|
||||
var _this = this;
|
||||
if (data) {
|
||||
this.$calendars = [];
|
||||
@@ -105,6 +106,11 @@
|
||||
_this.$calendars.push(calendar);
|
||||
});
|
||||
}
|
||||
|
||||
if (writable) {
|
||||
return _.union(this.$calendars, _.filter(this.$subscriptions, function(calendar) { return calendar.acls.objectCreator; }));
|
||||
}
|
||||
|
||||
return _.union(this.$calendars, this.$subscriptions, this.$webcalendars);
|
||||
};
|
||||
|
||||
|
||||
@@ -149,7 +149,7 @@
|
||||
function ComponentEditorController($rootScope, $scope, $log, $timeout, $mdDialog, User, Calendar, Component, AddressBook, Card, Alarm, stateComponent) {
|
||||
var vm = this, component, oldStartDate, oldEndDate, oldDueDate;
|
||||
|
||||
vm.calendars = Calendar.$calendars;
|
||||
vm.service = Calendar;
|
||||
vm.component = stateComponent;
|
||||
vm.categories = {};
|
||||
vm.showRecurrenceEditor = vm.component.$hasCustomRepeat;
|
||||
|
||||
Reference in New Issue
Block a user