Ejemplo n.º 1
0
 /**
  * Check if the user has the given capability for the requested track
  */
 public function _has_capability($capability, $id = null)
 {
     $id = $id ? $id : $this->required_param('id', PARAM_INT);
     $cached = trackpage::check_cached($capability, $id);
     if ($cached !== null) {
         return $cached;
     }
     $context = \local_elisprogram\context\track::instance($id);
     return has_capability($capability, $context);
 }
Ejemplo n.º 2
0
 /**
  * Check if the user has the given capability for the requested track
  */
 function _has_capability($capability, $id = null)
 {
     $id = $id ? $id : $this->required_param('id', PARAM_INT);
     $cached = trackpage::check_cached($capability, $id);
     if ($cached !== null) {
         return $cached;
     }
     $context = get_context_instance(context_level_base::get_custom_context_level('track', 'block_curr_admin'), $id);
     return has_capability($capability, $context);
 }