Beispiel #1
0
 /**
  * Create an instance for this plug-in
  *
  * @static
  * @param string $type the type of the repository
  * @param int $userid the user id
  * @param stdClass $context the context
  * @param array $params the options for this instance
  * @param int $readonly whether to create it readonly or not (defaults to not)
  * @return mixed
  */
 public static function create($type, $userid, $context, $params, $readonly = 0)
 {
     if (has_capability('moodle/site:config', context_system::instance())) {
         return parent::create($type, $userid, $context, $params, $readonly);
     } else {
         require_capability('moodle/site:config', context_system::instance());
         return false;
     }
 }
Beispiel #2
0
 public static function create($type, $userid, $context, $params, $readonly = 0)
 {
     global $PAGE;
     if (has_capability('moodle/site:config', get_system_context())) {
         return parent::create($type, $userid, $context, $params, $readonly);
     } else {
         require_capability('moodle/site:config', get_system_context());
         return false;
     }
 }
 /**
  * @param Request $request
  * @return mixed
  */
 public function create(Request $request)
 {
     $repository = $this->repository->create($request->all());
     return Response::json(['sucesso' => ['message' => 'Coméntario CRIADO com sucesso', 'data' => $repository]], 200);
 }