Skip to content

Commit

Permalink
Issue #27: Put a doc comment on WopiController::permissionDenied(), d…
Browse files Browse the repository at this point in the history
…rop the `@todo` in the controller method.
  • Loading branch information
donquixote authored and hfiguiere committed Oct 24, 2024
1 parent 5688853 commit 71b5533
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/Controller/WopiController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,13 @@
*/
class WopiController extends ControllerBase {

static function permissionDenied() {
/**
* Creates a failure response that is understood by Collabora.
*
* @return \Symfony\Component\HttpFoundation\Response
* Response object.
*/
static function permissionDenied(): Response {
return new Response(
'Authentication failed.',
Response::HTTP_FORBIDDEN,
Expand All @@ -44,7 +50,6 @@ function wopiCheckFileInfo(string $id, Request $request) {
/** @var \Drupal\media\MediaInterface|null $media */
$media = \Drupal::entityTypeManager()->getStorage('media')->load($id);
if (!$media) {
// @todo Use default mechanism for access denied response.
return static::permissionDenied();
}

Expand Down

0 comments on commit 71b5533

Please sign in to comment.