lib/jwt/taskrouter/util.js
function defaultWorkerPolicies(version, workspaceSid, workerSid) {
  var activities = new Policy({
    url: _.join([TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Activities'], '/'),
    method: 'GET',
    allow: true
  });
  var tasks = new Policy({
    url: _.join([TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Tasks', '**'], '/'),
    method: 'GET',
    allow: true
  });
  var reservations = new Policy({
    url: _.join(
      [TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Workers', workerSid, 'Reservations', '**'],
      '/'
    ),
    method: 'GET',
    allow: true
  });
  var workerFetch = new Policy({
    url: _.join([TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Workers', workerSid], '/'),
    method: 'GET',
    allow: true
  });

  return [activities, tasks, reservations, workerFetch];
}
function defaultWorkerPolicies(version, workspaceSid, workerSid) {
  var activities = new Policy({
    url: _.join([TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Activities'], '/'),
    method: 'GET',
    allow: true
  });
  var tasks = new Policy({
    url: _.join([TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Tasks', '**'], '/'),
    method: 'GET',
    allow: true
  });
  var reservations = new Policy({
    url: _.join(
      [TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Workers', workerSid, 'Reservations', '**'],
      '/'
    ),
    method: 'GET',
    allow: true
  });
  var workerFetch = new Policy({
    url: _.join([TASKROUTER_BASE_URL, version, 'Workspaces', workspaceSid, 'Workers', workerSid], '/'),
    method: 'GET',
    allow: true
  });

  return [activities, tasks, reservations, workerFetch];
}
function defaultWorkerPolicies ( version , workspaceSid , workerSid ) { var activities = new Policy ( { url : _ . join ( [ TASKROUTER_BASE_URL , version , 'Workspaces' , workspaceSid , 'Activities' ] , '/' ) , method : 'GET' , allow : true } ) ; var tasks = new Policy ( { url : _ . join ( [ TASKROUTER_BASE_URL , version , 'Workspaces' , workspaceSid , 'Tasks' , '**' ] , '/' ) , method : 'GET' , allow : true } ) ; var reservations = new Policy ( { url : _ . join ( [ TASKROUTER_BASE_URL , version , 'Workspaces' , workspaceSid , 'Workers' , workerSid , 'Reservations' , '**' ] , '/' ) , method : 'GET' , allow : true } ) ; var workerFetch = new Policy ( { url : _ . join ( [ TASKROUTER_BASE_URL , version , 'Workspaces' , workspaceSid , 'Workers' , workerSid ] , '/' ) , method : 'GET' , allow : true } ) ; return [ activities , tasks , reservations , workerFetch ] ; }
Build the default Policies for a worker

@param {string} version TaskRouter version
@param {string} workspaceSid workspace sid
@param {string} workerSid worker sid
@returns {Array<Policy>} list of Policies
Build the default Policies for a worker