When I was on my user 1 account, it worked fine. But when I tried using a regular user account, I get this in the browser console:

GET http://localhost/drupal/date-restrictions/allowed-values/work_calendar/node%3Arequest%3A5/2014/06 403 (Forbidden) jquery-1.7.1.min.js:4
send jquery-1.7.1.min.js:4
f.extend.ajax jquery-1.7.1.min.js:4
(anonymous function) date_restrictions_datepicker.js?n8388o:35
dateRestrictionsCheckDate date_restrictions_datepicker.js?n8388o:44
d.extend._generateHTML jquery.ui.datepicker.min.js?v=1.8.7:71
d.extend._updateDatepicker jquery.ui.datepicker.min.js?v=1.8.7:39
$.datepicker._updateDatepicker jquery-ui-timepicker-addon.js?v=1.4:1426
d.extend._showDatepicker jquery.ui.datepicker.min.js?v=1.8.7:37
f.event.dispatch jquery-1.7.1.min.js:3
h.handle.i jquery-1.7.1.min.js:3
f.event.trigger jquery-1.7.1.min.js:3

I tried visiting the URL manually as user 1 and I get a JSON of dates. But if I visit the URL using a regular user account, I get a 403 page.

Comments

radj’s picture

Project: Date Restrictions » Work Calendar
StatusFileSize
new2.01 KB

It seems this is a work_calendar problem. It turns out, the coding in work_calendar_access() only looks for permission `administer all work calendars` to allow access to work calendars. Attached is an updated work_calendar.module file with additional permission `view work calendars` and related code to improve this.

radj’s picture

Assigned: Unassigned » radj
Status: Active » Needs review
jonhattan’s picture

I haven't had time to review this yet. Can you please provide a patch instead of a zip?

radj’s picture

First time submitting a patch from Git. Had to clone work_calendar repo. Sorry, not very well-versed with Drupal dev. Hehe. Attached patch.

  • jonhattan committed 32ad7d1 on 7.x-1.x authored by radj
    Issue #2296535 by radj: 403 for date-restrictions/allowed-values/...
jonhattan’s picture

Status: Needs review » Fixed

Commited. Thanks!

  • jonhattan committed 916bb43 on 7.x-2.x authored by radj
    Issue #2296535 by radj: 403 for date-restrictions/allowed-values/...
jonhattan’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.