title: Change global "editable" callback value in FullCalendar based on user role
body: <p>I am using the <a href="http://arshaw.com/fullcalendar/" rel="nofollow">FullCalendar</a> jQuery plugin along with ColdFusion and MySQL. I have two user levels, 'Admin' and 'Read-Only'. I would like the 'Read-Only' users to only be able to view events on the calendar and not make any changes, while the 'Admin' role has full editing capabilities. I was hoping to do this by adding a function to the FullCalendar <code>editable</code> option that would be set to <code>true</code> if the user's role is an Admin and <code>false</code> if the user role Read-Only. </p>
  
  <p>The variable <code>userRole</code> is set in the page header based on a ColdFusion session variable. I verified that <code>userRole</code> does contain the correct string when called in the javascript.</p>
  
  <p>What I tried:</p>
  
  <pre><code>$("#calendar").fullCalendar({
      // other options and callbacks
      // ....
  
      editable: function(){
          if (userRole == 'Read-Only') {
              return false //events can not be modified
          }
          else if (userRole == 'Admin') {         
              return true  //events can be modified
          }
      },
      // other callbacks
      // ...
  });
  </code></pre>
  
  <p>When I step through the code with Firebug, the whole function for the <code>editable</code> option is skipped and events are editable for both user types. </p>
  
  <p>Is there a flaw in my jQuery function (I'm new to programming in jQuery)? Does the FullCalendar <code>editable</code> option not allow a function? </p>
  
  <p>I can get around this by doing a user role check for each FullCalendar callback (e.g. eventDrop, eventResize, select, and eventClick) </p>
  
  <pre><code>select: function(start, end, allDay) {
          // check if user is Admin, if not, unselect and return
          if (userRole != 'Admin') {
              alert("You do not have the permissions to edit events.");
              $("#calendar").fullCalendar( 'unselect' );
              return
          }
  
          // proceed if user is Admin
          // ...
  }
  </code></pre>
  
  <p>and only proceed if the user role is 'Admin', but I was hoping to be able to set the role more globally. </p>
  
  <p>Ideas?</p>