diff --git a/README.md b/README.md index 30da659217..74dd4f8ef2 100644 --- a/README.md +++ b/README.md @@ -171,7 +171,9 @@ Libraries Get the token: -`curl -k -X POST -H "Content-Type: application/json" https://example.com/api/authentication_token -d '{"username":"admin","password":"admin"}'` +``` +curl -k -X POST -H "Content-Type: application/json" https://example.com/api/authentication_token -d '{"username":"admin","password":"admin"}' +``` The response should return something like: diff --git a/src/CoreBundle/Security/Authorization/Voter/CourseVoter.php b/src/CoreBundle/Security/Authorization/Voter/CourseVoter.php index 4db4fc59b3..eec369b692 100644 --- a/src/CoreBundle/Security/Authorization/Voter/CourseVoter.php +++ b/src/CoreBundle/Security/Authorization/Voter/CourseVoter.php @@ -46,6 +46,7 @@ class CourseVoter extends Voter if (!\in_array($attribute, $options, true)) { return false; } + // only vote on Post objects inside this voter return $subject instanceof Course; } @@ -54,12 +55,12 @@ class CourseVoter extends Voter { /** @var User $user */ $user = $token->getUser(); - // Anons can enter a course depending of the course visibility + // Anons can enter a course depending on the course visibility. /*if (!$user instanceof UserInterface) { return false; }*/ - // Admins have access to everything + // Admins have access to everything. if ($this->security->isGranted('ROLE_ADMIN')) { return true; } diff --git a/src/CourseBundle/Controller/ToolBaseController.php b/src/CourseBundle/Controller/ToolBaseController.php index fbdff30a67..006bd2084a 100644 --- a/src/CourseBundle/Controller/ToolBaseController.php +++ b/src/CourseBundle/Controller/ToolBaseController.php @@ -11,7 +11,7 @@ use Chamilo\CoreBundle\Traits\ControllerTrait; use Chamilo\CoreBundle\Traits\CourseControllerTrait; /** - * Each entity controller must extends this class. + * Each entity controller must extend this class. * * @abstract */