зеркало из https://github.com/mozilla/pjs.git
Bug 385439 - wcap calendar in read only mode -> but new event creation is possible; r=dbo
This commit is contained in:
Родитель
b0e1141c02
Коммит
068d284e38
|
@ -389,12 +389,22 @@ calWcapCalendar.prototype = {
|
|||
// xxx todo: take real acl into account
|
||||
// for now, optimistically assuming that everybody has full access, server will check:
|
||||
var granted = calIWcapCalendar.AC_FULL;
|
||||
if (this.m_bReadOnly) {
|
||||
granted &= ~(calIWcapCalendar.AC_COMP_WRITE |
|
||||
calIWcapCalendar.AC_PROP_WRITE);
|
||||
}
|
||||
// check whether every bit fits:
|
||||
return ((accessControlBits & granted) == accessControlBits);
|
||||
},
|
||||
|
||||
assureAccess: function calWcapCalendar_assureAccess(accessControlBits)
|
||||
{
|
||||
if (!this.checkAccess(accessControlBits & (calIWcapCalendar.AC_COMP_WRITE |
|
||||
calIWcapCalendar.AC_PROP_WRITE))) {
|
||||
// throw different error code for read-only:
|
||||
throw new Components.Exception("Access denied!",
|
||||
calIErrors.CAL_IS_READONLY);
|
||||
}
|
||||
if (!this.checkAccess(accessControlBits)) {
|
||||
throw new Components.Exception("Access denied!",
|
||||
calIWcapErrors.WCAP_ACCESS_DENIED_TO_CALENDAR);
|
||||
|
|
|
@ -49,6 +49,7 @@ const calIWcapErrors = Components.interfaces.calIWcapErrors;
|
|||
const calICalendar = Components.interfaces.calICalendar;
|
||||
const calIItemBase = Components.interfaces.calIItemBase;
|
||||
const calIOperationListener = Components.interfaces.calIOperationListener;
|
||||
const calIErrors = Components.interfaces.calIErrors;
|
||||
|
||||
// ctors:
|
||||
var CalEvent;
|
||||
|
|
|
@ -74,7 +74,8 @@ function initLogging()
|
|||
logFile,
|
||||
0x02 /* PR_WRONLY */ |
|
||||
0x08 /* PR_CREATE_FILE */ |
|
||||
0x10 /* PR_APPEND */,
|
||||
(getPref("calendar.wcap.log_file_append", false)
|
||||
? 0x10 /* PR_APPEND */ : 0x20 /* PR_TRUNCATE */),
|
||||
0700 /* read, write, execute/search by owner */,
|
||||
0 /* unused */);
|
||||
g_logFilestream = logFileStream;
|
||||
|
@ -297,7 +298,7 @@ function getTime() {
|
|||
}
|
||||
|
||||
function getIcalUTC(dt) {
|
||||
if (!dt)
|
||||
if (!dt || !dt.isValid)
|
||||
return "0";
|
||||
else {
|
||||
var dtz = dt.timezone;
|
||||
|
|
Загрузка…
Ссылка в новой задаче