Set automaticly the Authentication params when JMS Secure annotation is set

This commit is contained in:
fvilpoix 2012-12-27 10:18:15 +01:00
parent 0aa1619c5f
commit fdc814e264

View File

@ -28,6 +28,8 @@ class ApiDocExtractor
const FOS_REST_REQUEST_PARAM_CLASS = 'FOS\\RestBundle\\Controller\\Annotations\\RequestParam'; const FOS_REST_REQUEST_PARAM_CLASS = 'FOS\\RestBundle\\Controller\\Annotations\\RequestParam';
const JMS_SECURITY_EXTRA_SECURE_CLASS = 'JMS\\SecurityExtraBundle\\Annotation\\Secure';
/** /**
* @var ContainerInterface * @var ContainerInterface
*/ */
@ -360,6 +362,8 @@ class ApiDocExtractor
'description' => $annot->description, 'description' => $annot->description,
'readonly' => false 'readonly' => false
)); ));
} elseif (is_a($annot, self::JMS_SECURITY_EXTRA_SECURE_CLASS)) {
$annotation->setAuthentication(true);
} }
} }
} }