mirror of
https://github.com/wallabag/wallabag.git
synced 2025-04-23 18:34:06 +00:00
Migrate to SensioLabs attributes
This commit is contained in:
parent
a766826a69
commit
4e177e1778
30 changed files with 122 additions and 192 deletions
|
@ -15,7 +15,7 @@ return RectorConfig::configure()
|
|||
])
|
||||
->withRootFiles()
|
||||
->withImportNames(importShortClasses: false)
|
||||
->withAttributesSets(symfony: true, doctrine: true, gedmo: true, jms: true)
|
||||
->withAttributesSets(symfony: true, doctrine: true, gedmo: true, jms: true, sensiolabs: true)
|
||||
->withConfiguredRule(ClassPropertyAssignToConstructorPromotionRector::class, [
|
||||
'inline_public' => true,
|
||||
])
|
||||
|
|
|
@ -32,10 +32,10 @@ class AnnotationController extends AbstractFOSRestController
|
|||
*
|
||||
* @see Api\WallabagRestController
|
||||
*
|
||||
* @IsGranted("LIST_ANNOTATIONS", subject="entry")
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/annotations/{entry}.{_format}', name: 'annotations_get_annotations', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('LIST_ANNOTATIONS', subject: 'entry')]
|
||||
public function getAnnotationsAction(Entry $entry, AnnotationRepository $annotationRepository)
|
||||
{
|
||||
$annotationRows = $annotationRepository->findByEntryIdAndUserId($entry->getId(), $this->getUser()->getId());
|
||||
|
@ -53,10 +53,10 @@ class AnnotationController extends AbstractFOSRestController
|
|||
*
|
||||
* @see Api\WallabagRestController
|
||||
*
|
||||
* @IsGranted("CREATE_ANNOTATIONS", subject="entry")
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/annotations/{entry}.{_format}', name: 'annotations_post_annotation', methods: ['POST'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('CREATE_ANNOTATIONS', subject: 'entry')]
|
||||
public function postAnnotationAction(Request $request, Entry $entry)
|
||||
{
|
||||
$data = json_decode($request->getContent(), true);
|
||||
|
@ -87,10 +87,10 @@ class AnnotationController extends AbstractFOSRestController
|
|||
*
|
||||
* @see Api\WallabagRestController
|
||||
*
|
||||
* @IsGranted("EDIT", subject="annotation")
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/annotations/{annotation}.{_format}', name: 'annotations_put_annotation', methods: ['PUT'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('EDIT', subject: 'annotation')]
|
||||
public function putAnnotationAction(Request $request, Annotation $annotation)
|
||||
{
|
||||
try {
|
||||
|
@ -122,10 +122,10 @@ class AnnotationController extends AbstractFOSRestController
|
|||
*
|
||||
* @see Api\WallabagRestController
|
||||
*
|
||||
* @IsGranted("DELETE", subject="annotation")
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/annotations/{annotation}.{_format}', name: 'annotations_delete_annotation', methods: ['DELETE'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('DELETE', subject: 'annotation')]
|
||||
public function deleteAnnotationAction(Annotation $annotation)
|
||||
{
|
||||
try {
|
||||
|
|
|
@ -34,11 +34,11 @@ class AnnotationRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("LIST_ANNOTATIONS", subject="entry")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/api/annotations/{entry}.{_format}', name: 'api_get_annotations', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('LIST_ANNOTATIONS', subject: 'entry')]
|
||||
public function getAnnotationsAction(Entry $entry)
|
||||
{
|
||||
return $this->forward('Wallabag\Controller\AnnotationController::getAnnotationsAction', [
|
||||
|
@ -99,11 +99,10 @@ class AnnotationRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("CREATE_ANNOTATIONS", subject="entry")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/api/annotations/{entry}.{_format}', name: 'api_post_annotation', methods: ['POST'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('CREATE_ANNOTATIONS', subject: 'entry')]
|
||||
public function postAnnotationAction(Request $request, Entry $entry)
|
||||
{
|
||||
return $this->forward('Wallabag\Controller\AnnotationController::postAnnotationAction', [
|
||||
|
@ -133,11 +132,11 @@ class AnnotationRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("EDIT", subject="annotation")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/api/annotations/{annotation}.{_format}', name: 'api_put_annotation', methods: ['PUT'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('EDIT', subject: 'annotation')]
|
||||
public function putAnnotationAction(Annotation $annotation, Request $request)
|
||||
{
|
||||
return $this->forward('Wallabag\Controller\AnnotationController::putAnnotationAction', [
|
||||
|
@ -167,11 +166,11 @@ class AnnotationRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("DELETE", subject="annotation")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/api/annotations/{annotation}.{_format}', name: 'api_delete_annotation', methods: ['DELETE'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('DELETE', subject: 'annotation')]
|
||||
public function deleteAnnotationAction(Annotation $annotation)
|
||||
{
|
||||
return $this->forward('Wallabag\Controller\AnnotationController::deleteAnnotationAction', [
|
||||
|
|
|
@ -85,11 +85,10 @@ class EntryRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/exists.{_format}', name: 'api_get_entries_exists', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function getEntriesExistsAction(Request $request, EntryRepository $entryRepository)
|
||||
{
|
||||
$returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id');
|
||||
|
@ -297,11 +296,10 @@ class EntryRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries.{_format}', name: 'api_get_entries', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function getEntriesAction(Request $request, EntryRepository $entryRepository)
|
||||
{
|
||||
$isArchived = (null === $request->query->get('archive')) ? null : (bool) $request->query->get('archive');
|
||||
|
@ -387,11 +385,11 @@ class EntryRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("VIEW", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/{entry}.{_format}', name: 'api_get_entry', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('VIEW', subject: 'entry')]
|
||||
public function getEntryAction(Entry $entry)
|
||||
{
|
||||
return $this->sendResponse($entry);
|
||||
|
@ -429,11 +427,10 @@ class EntryRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("VIEW", subject="entry")
|
||||
*
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/api/entries/{entry}/export.{_format}', name: 'api_get_entry_export', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('VIEW', subject: 'entry')]
|
||||
public function getEntryExportAction(Entry $entry, Request $request, EntriesExport $entriesExport)
|
||||
{
|
||||
return $entriesExport
|
||||
|
@ -461,11 +458,11 @@ class EntryRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("DELETE_ENTRIES")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/list.{_format}', name: 'api_delete_entries_list', methods: ['DELETE'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('DELETE_ENTRIES')]
|
||||
public function deleteEntriesListAction(Request $request, EntryRepository $entryRepository, EventDispatcherInterface $eventDispatcher)
|
||||
{
|
||||
$urls = json_decode($request->query->get('urls', '[]'));
|
||||
|
@ -518,13 +515,12 @@ class EntryRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("CREATE_ENTRIES")
|
||||
*
|
||||
* @throws HttpException When limit is reached
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/lists.{_format}', name: 'api_post_entries_list', methods: ['POST'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('CREATE_ENTRIES')]
|
||||
public function postEntriesListAction(Request $request, EntryRepository $entryRepository, EventDispatcherInterface $eventDispatcher, ContentProxy $contentProxy)
|
||||
{
|
||||
$urls = json_decode($request->query->get('urls', '[]'));
|
||||
|
@ -702,11 +698,10 @@ class EntryRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("CREATE_ENTRIES")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries.{_format}', name: 'api_post_entries', methods: ['POST'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('CREATE_ENTRIES')]
|
||||
public function postEntriesAction(
|
||||
Request $request,
|
||||
EntryRepository $entryRepository,
|
||||
|
@ -926,11 +921,10 @@ class EntryRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("EDIT", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/{entry}.{_format}', name: 'api_patch_entries', methods: ['PATCH'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('EDIT', subject: 'entry')]
|
||||
public function patchEntriesAction(Entry $entry, Request $request, ContentProxy $contentProxy, LoggerInterface $logger, TagsAssigner $tagsAssigner, EventDispatcherInterface $eventDispatcher)
|
||||
{
|
||||
$data = $this->retrieveValueFromRequest($request);
|
||||
|
@ -1040,11 +1034,11 @@ class EntryRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("RELOAD", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/{entry}/reload.{_format}', name: 'api_patch_entries_reload', methods: ['PATCH'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('RELOAD', subject: 'entry')]
|
||||
public function patchEntriesReloadAction(Entry $entry, ContentProxy $contentProxy, LoggerInterface $logger, EventDispatcherInterface $eventDispatcher)
|
||||
{
|
||||
try {
|
||||
|
@ -1094,11 +1088,11 @@ class EntryRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("DELETE", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/{entry}.{_format}', name: 'api_delete_entries', methods: ['DELETE'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('DELETE', subject: 'entry')]
|
||||
public function deleteEntriesAction(Entry $entry, Request $request, EventDispatcherInterface $eventDispatcher)
|
||||
{
|
||||
$expect = $request->query->get('expect', 'entry');
|
||||
|
@ -1145,11 +1139,11 @@ class EntryRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("LIST_TAGS", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/{entry}/tags.{_format}', name: 'api_get_entries_tags', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('LIST_TAGS', subject: 'entry')]
|
||||
public function getEntriesTagsAction(Entry $entry)
|
||||
{
|
||||
return $this->sendResponse($entry->getTags());
|
||||
|
@ -1187,11 +1181,10 @@ class EntryRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("TAG", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/{entry}/tags.{_format}', name: 'api_post_entries_tags', methods: ['POST'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('TAG', subject: 'entry')]
|
||||
public function postEntriesTagsAction(Request $request, Entry $entry, TagsAssigner $tagsAssigner)
|
||||
{
|
||||
$tags = $request->request->get('tags', '');
|
||||
|
@ -1237,11 +1230,10 @@ class EntryRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("UNTAG", subject="entry")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/{entry}/tags/{tag}.{_format}', name: 'api_delete_entries_tags', methods: ['DELETE'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('UNTAG', subject: 'entry')]
|
||||
public function deleteEntriesTagsAction(Entry $entry, Tag $tag)
|
||||
{
|
||||
$entry->removeTag($tag);
|
||||
|
@ -1270,11 +1262,11 @@ class EntryRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("DELETE_TAGS")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/tags/list.{_format}', name: 'api_delete_entries_tags_list', methods: ['DELETE'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('DELETE_TAGS')]
|
||||
public function deleteEntriesTagsListAction(Request $request, TagRepository $tagRepository, EntryRepository $entryRepository)
|
||||
{
|
||||
$list = json_decode($request->query->get('list', '[]'));
|
||||
|
@ -1335,11 +1327,11 @@ class EntryRestController extends WallabagRestController
|
|||
* description="Returned when successful"
|
||||
* )
|
||||
* )
|
||||
* @IsGranted("CREATE_TAGS")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/entries/tags/lists.{_format}', name: 'api_post_entries_tags_list', methods: ['POST'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('CREATE_TAGS')]
|
||||
public function postEntriesTagsListAction(Request $request, EntryRepository $entryRepository, TagsAssigner $tagsAssigner)
|
||||
{
|
||||
$list = json_decode($request->query->get('list', '[]'));
|
||||
|
|
|
@ -55,11 +55,10 @@ class SearchRestController extends WallabagRestController
|
|||
* )
|
||||
* )
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
*
|
||||
* @return JsonResponse
|
||||
*/
|
||||
#[Route(path: '/api/search.{_format}', name: 'api_get_search', methods: ['GET'], defaults: ['_format' => 'json'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function getSearchAction(Request $request, EntryRepository $entryRepository)
|
||||
{
|
||||
$term = $request->query->get('term');
|
||||
|
|
|
@ -56,10 +56,8 @@ class ConfigController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
*/
|
||||
#[Route(path: '/config', name: 'config', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function indexAction(Request $request, Config $craueConfig, TaggingRuleRepository $taggingRuleRepository, IgnoreOriginUserRuleRepository $ignoreOriginUserRuleRepository, UserRepository $userRepository)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
@ -249,10 +247,9 @@ class ConfigController extends AbstractController
|
|||
|
||||
/**
|
||||
* Disable 2FA using email.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
*/
|
||||
#[Route(path: '/config/otp/email/disable', name: 'disable_otp_email', methods: ['POST'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function disableOtpEmailAction(Request $request)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||
|
@ -275,10 +272,9 @@ class ConfigController extends AbstractController
|
|||
|
||||
/**
|
||||
* Enable 2FA using email.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
*/
|
||||
#[Route(path: '/config/otp/email', name: 'config_otp_email', methods: ['POST'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function otpEmailAction(Request $request)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||
|
@ -304,10 +300,9 @@ class ConfigController extends AbstractController
|
|||
|
||||
/**
|
||||
* Disable 2FA using OTP app.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
*/
|
||||
#[Route(path: '/config/otp/app/disable', name: 'disable_otp_app', methods: ['POST'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function disableOtpAppAction(Request $request)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||
|
@ -332,10 +327,9 @@ class ConfigController extends AbstractController
|
|||
|
||||
/**
|
||||
* Enable 2FA using OTP app, user will need to confirm the generated code from the app.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
*/
|
||||
#[Route(path: '/config/otp/app', name: 'config_otp_app', methods: ['POST'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function otpAppAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||
|
@ -392,10 +386,9 @@ class ConfigController extends AbstractController
|
|||
|
||||
/**
|
||||
* Validate OTP code.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
*/
|
||||
#[Route(path: '/config/otp/app/check', name: 'config_otp_app_check', methods: ['POST'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function otpAppCheckAction(Request $request, GoogleAuthenticatorInterface $googleAuthenticator)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('otp', $request->request->get('token'))) {
|
||||
|
@ -430,10 +423,10 @@ class ConfigController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
* @return RedirectResponse|JsonResponse
|
||||
*/
|
||||
#[Route(path: '/generate-token', name: 'generate_token', methods: ['GET'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function generateTokenAction(Request $request)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
@ -455,10 +448,10 @@ class ConfigController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
* @return RedirectResponse|JsonResponse
|
||||
*/
|
||||
#[Route(path: '/revoke-token', name: 'revoke_token', methods: ['GET'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function revokeTokenAction(Request $request)
|
||||
{
|
||||
$config = $this->getConfig();
|
||||
|
@ -482,10 +475,10 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Deletes a tagging rule and redirect to the config homepage.
|
||||
*
|
||||
* @IsGranted("DELETE", subject="taggingRule")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/tagging-rule/delete/{taggingRule}', name: 'delete_tagging_rule', methods: ['GET'], requirements: ['taggingRule' => '\d+'])]
|
||||
#[IsGranted('DELETE', subject: 'taggingRule')]
|
||||
public function deleteTaggingRuleAction(TaggingRule $taggingRule)
|
||||
{
|
||||
$this->entityManager->remove($taggingRule);
|
||||
|
@ -502,10 +495,10 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Edit a tagging rule.
|
||||
*
|
||||
* @IsGranted("EDIT", subject="taggingRule")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/tagging-rule/edit/{taggingRule}', name: 'edit_tagging_rule', methods: ['GET'], requirements: ['taggingRule' => '\d+'])]
|
||||
#[IsGranted('EDIT', subject: 'taggingRule')]
|
||||
public function editTaggingRuleAction(TaggingRule $taggingRule)
|
||||
{
|
||||
return $this->redirect($this->generateUrl('config') . '?tagging-rule=' . $taggingRule->getId() . '#set5');
|
||||
|
@ -514,10 +507,10 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Deletes an ignore origin rule and redirect to the config homepage.
|
||||
*
|
||||
* @IsGranted("DELETE", subject="ignoreOriginUserRule")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/ignore-origin-user-rule/delete/{ignoreOriginUserRule}', name: 'delete_ignore_origin_rule', methods: ['GET'], requirements: ['ignoreOriginUserRule' => '\d+'])]
|
||||
#[IsGranted('DELETE', subject: 'ignoreOriginUserRule')]
|
||||
public function deleteIgnoreOriginRuleAction(IgnoreOriginUserRule $ignoreOriginUserRule)
|
||||
{
|
||||
$this->entityManager->remove($ignoreOriginUserRule);
|
||||
|
@ -534,10 +527,10 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Edit an ignore origin rule.
|
||||
*
|
||||
* @IsGranted("EDIT", subject="ignoreOriginUserRule")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/ignore-origin-user-rule/edit/{ignoreOriginUserRule}', name: 'edit_ignore_origin_rule', methods: ['GET'], requirements: ['ignoreOriginUserRule' => '\d+'])]
|
||||
#[IsGranted('EDIT', subject: 'ignoreOriginUserRule')]
|
||||
public function editIgnoreOriginRuleAction(IgnoreOriginUserRule $ignoreOriginUserRule)
|
||||
{
|
||||
return $this->redirect($this->generateUrl('config') . '?ignore-origin-user-rule=' . $ignoreOriginUserRule->getId() . '#set6');
|
||||
|
@ -546,10 +539,10 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Remove all annotations OR tags OR entries for the current user.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/reset/{type}', name: 'config_reset', methods: ['POST'], requirements: ['id' => 'annotations|tags|entries|tagging_rules'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function resetAction(Request $request, string $type, AnnotationRepository $annotationRepository, EntryRepository $entryRepository, TaggingRuleRepository $taggingRuleRepository)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('reset-area', $request->request->get('token'))) {
|
||||
|
@ -601,12 +594,11 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Delete account for current user.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
*
|
||||
* @throws AccessDeniedHttpException
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/account/delete', name: 'delete_account', methods: ['POST'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function deleteAccountAction(Request $request, UserRepository $userRepository, TokenStorageInterface $tokenStorage)
|
||||
{
|
||||
if (!$this->isCsrfTokenValid('delete-account', $request->request->get('token'))) {
|
||||
|
@ -633,10 +625,10 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Switch view mode for current user.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/config/view-mode', name: 'switch_view_mode', methods: ['GET'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function changeViewModeAction(Request $request)
|
||||
{
|
||||
$user = $this->getUser();
|
||||
|
@ -655,10 +647,10 @@ class ConfigController extends AbstractController
|
|||
*
|
||||
* @param string $language
|
||||
*
|
||||
* @IsGranted("PUBLIC_ACCESS")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/locale/{language}', name: 'changeLocale', methods: ['GET'])]
|
||||
#[IsGranted('PUBLIC_ACCESS')]
|
||||
public function setLocaleAction(Request $request, ValidatorInterface $validator, $language = null)
|
||||
{
|
||||
$errors = $validator->validate($language, new LocaleConstraint(['canonicalize' => true]));
|
||||
|
@ -673,10 +665,10 @@ class ConfigController extends AbstractController
|
|||
/**
|
||||
* Export tagging rules for the logged in user.
|
||||
*
|
||||
* @IsGranted("EDIT_CONFIG")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/tagging-rule/export', name: 'export_tagging_rule', methods: ['GET'])]
|
||||
#[IsGranted('EDIT_CONFIG')]
|
||||
public function exportTaggingRulesAction()
|
||||
{
|
||||
$data = SerializerBuilder::create()->build()->serialize(
|
||||
|
|
|
@ -46,10 +46,10 @@ class EntryController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("EDIT_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/mass', name: 'mass_action', methods: ['POST'])]
|
||||
#[IsGranted('EDIT_ENTRIES')]
|
||||
public function massAction(Request $request, TagRepository $tagRepository)
|
||||
{
|
||||
$values = $request->request->all();
|
||||
|
@ -131,13 +131,12 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
*
|
||||
* Default parameter for page is hardcoded (in duplication of the defaults from the Route)
|
||||
* because this controller is also called inside the layout template without any page as argument
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/search/{page}', name: 'search', methods: ['GET', 'POST'], defaults: ['page' => 1])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function searchFormAction(Request $request, $page = 1, $currentRoute = null)
|
||||
{
|
||||
// fallback to retrieve currentRoute from query parameter instead of injected one (when using inside a template)
|
||||
|
@ -160,10 +159,10 @@ class EntryController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("CREATE_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/new-entry', name: 'new_entry', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('CREATE_ENTRIES')]
|
||||
public function addEntryFormAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
$entry = new Entry($this->getUser());
|
||||
|
@ -203,10 +202,10 @@ class EntryController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("CREATE_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/bookmarklet', name: 'bookmarklet', methods: ['GET'])]
|
||||
#[IsGranted('CREATE_ENTRIES')]
|
||||
public function addEntryViaBookmarkletAction(Request $request)
|
||||
{
|
||||
$entry = new Entry($this->getUser());
|
||||
|
@ -226,10 +225,10 @@ class EntryController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("CREATE_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/new', name: 'new', methods: ['GET'])]
|
||||
#[IsGranted('CREATE_ENTRIES')]
|
||||
public function addEntryAction()
|
||||
{
|
||||
return $this->render('Entry/new.html.twig');
|
||||
|
@ -238,10 +237,10 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Edit an entry content.
|
||||
*
|
||||
* @IsGranted("EDIT", subject="entry")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/edit/{id}', name: 'edit', methods: ['GET', 'POST'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('EDIT', subject: 'entry')]
|
||||
public function editEntryAction(Request $request, Entry $entry)
|
||||
{
|
||||
$form = $this->createForm(EditEntryType::class, $entry);
|
||||
|
@ -270,10 +269,10 @@ class EntryController extends AbstractController
|
|||
*
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/all/list/{page}', name: 'all', methods: ['GET'], defaults: ['page' => '1'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function showAllAction(Request $request, $page)
|
||||
{
|
||||
return $this->showEntries('all', $request, $page);
|
||||
|
@ -284,10 +283,10 @@ class EntryController extends AbstractController
|
|||
*
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/unread/list/{page}', name: 'unread', methods: ['GET'], defaults: ['page' => '1'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function showUnreadAction(Request $request, $page)
|
||||
{
|
||||
// load the quickstart if no entry in database
|
||||
|
@ -303,10 +302,10 @@ class EntryController extends AbstractController
|
|||
*
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/archive/list/{page}', name: 'archive', methods: ['GET'], defaults: ['page' => '1'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function showArchiveAction(Request $request, $page)
|
||||
{
|
||||
return $this->showEntries('archive', $request, $page);
|
||||
|
@ -317,10 +316,10 @@ class EntryController extends AbstractController
|
|||
*
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/starred/list/{page}', name: 'starred', methods: ['GET'], defaults: ['page' => '1'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function showStarredAction(Request $request, $page)
|
||||
{
|
||||
return $this->showEntries('starred', $request, $page);
|
||||
|
@ -331,10 +330,10 @@ class EntryController extends AbstractController
|
|||
*
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/untagged/list/{page}', name: 'untagged', methods: ['GET'], defaults: ['page' => '1'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function showUntaggedEntriesAction(Request $request, $page)
|
||||
{
|
||||
return $this->showEntries('untagged', $request, $page);
|
||||
|
@ -345,10 +344,10 @@ class EntryController extends AbstractController
|
|||
*
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/annotated/list/{page}', name: 'annotated', methods: ['GET'], defaults: ['page' => '1'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function showWithAnnotationsEntriesAction(Request $request, $page)
|
||||
{
|
||||
return $this->showEntries('annotated', $request, $page);
|
||||
|
@ -357,10 +356,10 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Shows random entry depending on the given type.
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/{type}/random', name: 'random_entry', methods: ['GET'], requirements: ['type' => 'unread|starred|archive|untagged|annotated|all'])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function redirectRandomEntryAction(string $type = 'all')
|
||||
{
|
||||
try {
|
||||
|
@ -378,10 +377,10 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Shows entry content.
|
||||
*
|
||||
* @IsGranted("VIEW", subject="entry")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/view/{id}', name: 'view', methods: ['GET'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('VIEW', subject: 'entry')]
|
||||
public function viewAction(Entry $entry)
|
||||
{
|
||||
return $this->render(
|
||||
|
@ -394,10 +393,10 @@ class EntryController extends AbstractController
|
|||
* Reload an entry.
|
||||
* Refetch content from the website and make it readable again.
|
||||
*
|
||||
* @IsGranted("RELOAD", subject="entry")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/reload/{id}', name: 'reload_entry', methods: ['GET'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('RELOAD', subject: 'entry')]
|
||||
public function reloadAction(Entry $entry)
|
||||
{
|
||||
$this->updateEntry($entry, 'entry_reloaded');
|
||||
|
@ -421,10 +420,10 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Changes read status for an entry.
|
||||
*
|
||||
* @IsGranted("ARCHIVE", subject="entry")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/archive/{id}', name: 'archive_entry', methods: ['GET'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('ARCHIVE', subject: 'entry')]
|
||||
public function toggleArchiveAction(Request $request, Entry $entry)
|
||||
{
|
||||
$entry->toggleArchive();
|
||||
|
@ -448,10 +447,10 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Changes starred status for an entry.
|
||||
*
|
||||
* @IsGranted("STAR", subject="entry")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/star/{id}', name: 'star_entry', methods: ['GET'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('STAR', subject: 'entry')]
|
||||
public function toggleStarAction(Request $request, Entry $entry)
|
||||
{
|
||||
$entry->toggleStar();
|
||||
|
@ -476,10 +475,10 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Deletes entry and redirect to the homepage or the last viewed page.
|
||||
*
|
||||
* @IsGranted("DELETE", subject="entry")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/delete/{id}', name: 'delete_entry', methods: ['GET'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('DELETE', subject: 'entry')]
|
||||
public function deleteEntryAction(Request $request, Entry $entry)
|
||||
{
|
||||
// generates the view url for this entry to check for redirection later
|
||||
|
@ -512,10 +511,10 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Get public URL for entry (and generate it if necessary).
|
||||
*
|
||||
* @IsGranted("SHARE", subject="entry")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/share/{id}', name: 'share', methods: ['GET'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('SHARE', subject: 'entry')]
|
||||
public function shareAction(Entry $entry)
|
||||
{
|
||||
if (null === $entry->getUid()) {
|
||||
|
@ -533,10 +532,10 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Disable public sharing for an entry.
|
||||
*
|
||||
* @IsGranted("UNSHARE", subject="entry")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/share/delete/{id}', name: 'delete_share', methods: ['GET'], requirements: ['id' => '\d+'])]
|
||||
#[IsGranted('UNSHARE', subject: 'entry')]
|
||||
public function deleteShareAction(Entry $entry)
|
||||
{
|
||||
$entry->cleanUid();
|
||||
|
@ -552,11 +551,11 @@ class EntryController extends AbstractController
|
|||
/**
|
||||
* Ability to view a content publicly.
|
||||
*
|
||||
* @Cache(maxage="25200", smaxage="25200", public=true)
|
||||
* @IsGranted("PUBLIC_ACCESS")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/share/{uid}', name: 'share_entry', methods: ['GET'], requirements: ['uid' => '.+'])]
|
||||
#[Cache(maxage: 25200, smaxage: 25200, public: true)]
|
||||
#[IsGranted('PUBLIC_ACCESS')]
|
||||
public function shareEntryAction(Entry $entry, Config $craueConfig)
|
||||
{
|
||||
if (!$craueConfig->get('share_public')) {
|
||||
|
@ -574,10 +573,10 @@ class EntryController extends AbstractController
|
|||
*
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/domain/{id}/{page}', name: 'same_domain', methods: ['GET'], requirements: ['id' => '\d+'], defaults: ['page' => 1])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
public function getSameDomainEntries(Request $request, $page = 1)
|
||||
{
|
||||
return $this->showEntries('same-domain', $request, $page);
|
||||
|
|
|
@ -21,10 +21,10 @@ class ExportController extends AbstractController
|
|||
/**
|
||||
* Gets one entry content.
|
||||
*
|
||||
* @IsGranted("EXPORT", subject="entry")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/export/{entry}.{format}', name: 'export_entry', methods: ['GET'], requirements: ['format' => 'epub|pdf|json|xml|txt|csv|md', 'entry' => '\d+'])]
|
||||
#[IsGranted('EXPORT', subject: 'entry')]
|
||||
public function downloadEntryAction(Request $request, EntryRepository $entryRepository, EntriesExport $entriesExport, string $format, Entry $entry)
|
||||
{
|
||||
try {
|
||||
|
@ -41,10 +41,10 @@ class ExportController extends AbstractController
|
|||
/**
|
||||
* Export all entries for current user.
|
||||
*
|
||||
* @IsGranted("EXPORT_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/export/{category}.{format}', name: 'export_entries', methods: ['GET'], requirements: ['format' => 'epub|pdf|json|xml|txt|csv|md', 'category' => 'all|unread|starred|archive|tag_entries|untagged|search|annotated|same_domain'])]
|
||||
#[IsGranted('EXPORT_ENTRIES')]
|
||||
public function downloadEntriesAction(Request $request, EntryRepository $entryRepository, TagRepository $tagRepository, EntriesExport $entriesExport, string $format, string $category, int $entry = 0)
|
||||
{
|
||||
$method = ucfirst($category);
|
||||
|
|
|
@ -28,12 +28,11 @@ class FeedController extends AbstractController
|
|||
/**
|
||||
* Shows unread entries for current user.
|
||||
*
|
||||
* @IsGranted("PUBLIC_ACCESS")
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\Entity\User", converter="username_feed_token_converter")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/feed/{username}/{token}/unread/{page}', name: 'unread_feed', methods: ['GET'], defaults: ['page' => 1, '_format' => 'xml'])]
|
||||
#[IsGranted('PUBLIC_ACCESS')]
|
||||
#[ParamConverter('user', class: User::class, converter: 'username_feed_token_converter')]
|
||||
public function showUnreadFeedAction(User $user, $page)
|
||||
{
|
||||
return $this->showEntries('unread', $user, $page);
|
||||
|
@ -42,12 +41,11 @@ class FeedController extends AbstractController
|
|||
/**
|
||||
* Shows read entries for current user.
|
||||
*
|
||||
* @IsGranted("PUBLIC_ACCESS")
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\Entity\User", converter="username_feed_token_converter")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/feed/{username}/{token}/archive/{page}', name: 'archive_feed', methods: ['GET'], defaults: ['page' => 1, '_format' => 'xml'])]
|
||||
#[IsGranted('PUBLIC_ACCESS')]
|
||||
#[ParamConverter('user', class: User::class, converter: 'username_feed_token_converter')]
|
||||
public function showArchiveFeedAction(User $user, $page)
|
||||
{
|
||||
return $this->showEntries('archive', $user, $page);
|
||||
|
@ -56,12 +54,11 @@ class FeedController extends AbstractController
|
|||
/**
|
||||
* Shows starred entries for current user.
|
||||
*
|
||||
* @IsGranted("PUBLIC_ACCESS")
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\Entity\User", converter="username_feed_token_converter")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/feed/{username}/{token}/starred/{page}', name: 'starred_feed', methods: ['GET'], defaults: ['page' => 1, '_format' => 'xml'])]
|
||||
#[IsGranted('PUBLIC_ACCESS')]
|
||||
#[ParamConverter('user', class: User::class, converter: 'username_feed_token_converter')]
|
||||
public function showStarredFeedAction(User $user, $page)
|
||||
{
|
||||
return $this->showEntries('starred', $user, $page);
|
||||
|
@ -70,12 +67,11 @@ class FeedController extends AbstractController
|
|||
/**
|
||||
* Shows all entries for current user.
|
||||
*
|
||||
* @IsGranted("PUBLIC_ACCESS")
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\Entity\User", converter="username_feed_token_converter")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/feed/{username}/{token}/all/{page}', name: 'all_feed', methods: ['GET'], defaults: ['page' => 1, '_format' => 'xml'])]
|
||||
#[IsGranted('PUBLIC_ACCESS')]
|
||||
#[ParamConverter('user', class: User::class, converter: 'username_feed_token_converter')]
|
||||
public function showAllFeedAction(User $user, $page)
|
||||
{
|
||||
return $this->showEntries('all', $user, $page);
|
||||
|
@ -84,13 +80,12 @@ class FeedController extends AbstractController
|
|||
/**
|
||||
* Shows entries associated to a tag for current user.
|
||||
*
|
||||
* @IsGranted("PUBLIC_ACCESS")
|
||||
*
|
||||
* @ParamConverter("user", class="Wallabag\Entity\User", converter="username_feed_token_converter")
|
||||
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/feed/{username}/{token}/tags/{slug}/{page}', name: 'tag_feed', methods: ['GET'], defaults: ['page' => 1, '_format' => 'xml'])]
|
||||
#[IsGranted('PUBLIC_ACCESS')]
|
||||
#[ParamConverter('user', class: User::class, converter: 'username_feed_token_converter')]
|
||||
#[ParamConverter('tag', options: ['mapping' => ['slug' => 'slug']])]
|
||||
public function showTagsFeedAction(Request $request, User $user, Tag $tag, PreparePagerForEntries $preparePagerForEntries, $page)
|
||||
{
|
||||
$sort = $request->query->get('sort', 'created');
|
||||
|
|
|
@ -28,10 +28,9 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
|||
|
||||
/**
|
||||
* Lists all IgnoreOriginInstanceRule entities.
|
||||
*
|
||||
* @IsGranted("LIST_IGNORE_ORIGIN_INSTANCE_RULES")
|
||||
*/
|
||||
#[Route(path: '/ignore-origin-instance-rules', name: 'ignore_origin_instance_rules_index', methods: ['GET'])]
|
||||
#[IsGranted('LIST_IGNORE_ORIGIN_INSTANCE_RULES')]
|
||||
public function indexAction(IgnoreOriginInstanceRuleRepository $repository)
|
||||
{
|
||||
$rules = $repository->findAll();
|
||||
|
@ -44,10 +43,10 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
|||
/**
|
||||
* Creates a new ignore origin instance rule entity.
|
||||
*
|
||||
* @IsGranted("CREATE_IGNORE_ORIGIN_INSTANCE_RULES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/ignore-origin-instance-rules/new', name: 'ignore_origin_instance_rules_new', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('CREATE_IGNORE_ORIGIN_INSTANCE_RULES')]
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
$ignoreOriginInstanceRule = new IgnoreOriginInstanceRule();
|
||||
|
@ -76,10 +75,10 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
|||
/**
|
||||
* Displays a form to edit an existing ignore origin instance rule entity.
|
||||
*
|
||||
* @IsGranted("EDIT", subject="ignoreOriginInstanceRule")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/ignore-origin-instance-rules/{id}/edit', name: 'ignore_origin_instance_rules_edit', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('EDIT', subject: 'ignoreOriginInstanceRule')]
|
||||
public function editAction(Request $request, IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($ignoreOriginInstanceRule);
|
||||
|
@ -108,10 +107,10 @@ class IgnoreOriginInstanceRuleController extends AbstractController
|
|||
/**
|
||||
* Deletes a site credential entity.
|
||||
*
|
||||
* @IsGranted("DELETE", subject="ignoreOriginInstanceRule")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/ignore-origin-instance-rules/{id}', name: 'ignore_origin_instance_rules_delete', methods: ['DELETE'])]
|
||||
#[IsGranted('DELETE', subject: 'ignoreOriginInstanceRule')]
|
||||
public function deleteAction(Request $request, IgnoreOriginInstanceRule $ignoreOriginInstanceRule)
|
||||
{
|
||||
$form = $this->createDeleteForm($ignoreOriginInstanceRule);
|
||||
|
|
|
@ -14,10 +14,10 @@ use Wallabag\Import\ImportInterface;
|
|||
abstract class BrowserController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/import/browser', name: 'import_browser', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
$form = $this->createForm(UploadImportType::class);
|
||||
|
|
|
@ -21,10 +21,8 @@ class ChromeController extends BrowserController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/chrome', name: 'import_chrome', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
return parent::indexAction($request, $translator);
|
||||
|
|
|
@ -21,10 +21,8 @@ class DeliciousController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/delicious', name: 'import_delicious', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, DeliciousImport $delicious, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
$form = $this->createForm(UploadImportType::class);
|
||||
|
|
|
@ -21,10 +21,8 @@ class ElcuratorController extends WallabagController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/elcurator', name: 'import_elcurator', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
return parent::indexAction($request, $translator);
|
||||
|
|
|
@ -21,10 +21,8 @@ class FirefoxController extends BrowserController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/firefox', name: 'import_firefox', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
return parent::indexAction($request, $translator);
|
||||
|
|
|
@ -14,10 +14,10 @@ use Wallabag\Import\ImportInterface;
|
|||
abstract class HtmlController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/import/html', name: 'import_html', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
$form = $this->createForm(UploadImportType::class);
|
||||
|
|
|
@ -19,10 +19,8 @@ class ImportController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/', name: 'import', methods: ['GET'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function importAction(ImportChain $importChain)
|
||||
{
|
||||
return $this->render('Import/index.html.twig', [
|
||||
|
|
|
@ -21,10 +21,8 @@ class InstapaperController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/instapaper', name: 'import_instapaper', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, InstapaperImport $instapaper, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
$form = $this->createForm(UploadImportType::class);
|
||||
|
|
|
@ -21,10 +21,8 @@ class OmnivoreController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/omnivore', name: 'import_omnivore', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, OmnivoreImport $omnivore, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
$form = $this->createForm(UploadImportType::class);
|
||||
|
|
|
@ -21,10 +21,8 @@ class PinboardController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/pinboard', name: 'import_pinboard', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, PinboardImport $pinboard, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
$form = $this->createForm(UploadImportType::class);
|
||||
|
|
|
@ -25,10 +25,8 @@ class PocketController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/pocket', name: 'import_pocket', methods: ['GET'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(PocketImport $pocketImport)
|
||||
{
|
||||
$pocket = $this->getPocketImportService($pocketImport);
|
||||
|
@ -47,10 +45,8 @@ class PocketController extends AbstractController
|
|||
]);
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/pocket/auth', name: 'import_pocket_auth', methods: ['POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function authAction(Request $request, PocketImport $pocketImport)
|
||||
{
|
||||
$requestToken = $this->getPocketImportService($pocketImport)
|
||||
|
@ -78,10 +74,8 @@ class PocketController extends AbstractController
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/pocket/callback', name: 'import_pocket_callback', methods: ['GET'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function callbackAction(PocketImport $pocketImport, TranslatorInterface $translator)
|
||||
{
|
||||
$message = 'flashes.import.notice.failed';
|
||||
|
|
|
@ -21,10 +21,8 @@ class PocketHtmlController extends HtmlController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/pocket_html', name: 'import_pocket_html', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
return parent::indexAction($request, $translator);
|
||||
|
|
|
@ -21,10 +21,8 @@ class ReadabilityController extends AbstractController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/readability', name: 'import_readability', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, ReadabilityImport $readability, Config $craueConfig, TranslatorInterface $translator)
|
||||
{
|
||||
$form = $this->createForm(UploadImportType::class);
|
||||
|
|
|
@ -21,10 +21,8 @@ class ShaarliController extends HtmlController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/shaarli', name: 'import_shaarli', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
return parent::indexAction($request, $translator);
|
||||
|
|
|
@ -21,10 +21,8 @@ class WallabagV1Controller extends WallabagController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/wallabag-v1', name: 'import_wallabag_v1', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
return parent::indexAction($request, $translator);
|
||||
|
|
|
@ -21,10 +21,8 @@ class WallabagV2Controller extends WallabagController
|
|||
) {
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IMPORT_ENTRIES")
|
||||
*/
|
||||
#[Route(path: '/import/wallabag-v2', name: 'import_wallabag_v2', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('IMPORT_ENTRIES')]
|
||||
public function indexAction(Request $request, TranslatorInterface $translator)
|
||||
{
|
||||
return parent::indexAction($request, $translator);
|
||||
|
|
|
@ -33,10 +33,9 @@ class SiteCredentialController extends AbstractController
|
|||
|
||||
/**
|
||||
* Lists all User entities.
|
||||
*
|
||||
* @IsGranted("LIST_SITE_CREDENTIALS")
|
||||
*/
|
||||
#[Route(path: '/site-credentials', name: 'site_credentials_index', methods: ['GET'])]
|
||||
#[IsGranted('LIST_SITE_CREDENTIALS')]
|
||||
public function indexAction(SiteCredentialRepository $repository)
|
||||
{
|
||||
$this->isSiteCredentialsEnabled();
|
||||
|
@ -51,10 +50,10 @@ class SiteCredentialController extends AbstractController
|
|||
/**
|
||||
* Creates a new site credential entity.
|
||||
*
|
||||
* @IsGranted("CREATE_SITE_CREDENTIALS")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/site-credentials/new', name: 'site_credentials_new', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('CREATE_SITE_CREDENTIALS')]
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
$this->isSiteCredentialsEnabled();
|
||||
|
@ -88,10 +87,10 @@ class SiteCredentialController extends AbstractController
|
|||
/**
|
||||
* Displays a form to edit an existing site credential entity.
|
||||
*
|
||||
* @IsGranted("EDIT", subject="siteCredential")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/site-credentials/{id}/edit', name: 'site_credentials_edit', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('EDIT', subject: 'siteCredential')]
|
||||
public function editAction(Request $request, SiteCredential $siteCredential)
|
||||
{
|
||||
$this->isSiteCredentialsEnabled();
|
||||
|
@ -125,10 +124,10 @@ class SiteCredentialController extends AbstractController
|
|||
/**
|
||||
* Deletes a site credential entity.
|
||||
*
|
||||
* @IsGranted("DELETE", subject="siteCredential")
|
||||
* @return RedirectResponse
|
||||
*/
|
||||
#[Route(path: '/site-credentials/{id}', name: 'site_credentials_delete', methods: ['DELETE'])]
|
||||
#[IsGranted('DELETE', subject: 'siteCredential')]
|
||||
public function deleteAction(Request $request, SiteCredential $siteCredential)
|
||||
{
|
||||
$this->isSiteCredentialsEnabled();
|
||||
|
|
|
@ -7,10 +7,8 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
|
||||
class StaticController extends AbstractController
|
||||
{
|
||||
/**
|
||||
* @IsGranted("IS_AUTHENTICATED_FULLY")
|
||||
*/
|
||||
#[Route(path: '/howto', name: 'howto', methods: ['GET'])]
|
||||
#[IsGranted('IS_AUTHENTICATED_FULLY')]
|
||||
public function howtoAction()
|
||||
{
|
||||
$addonsUrl = $this->getParameter('addons_url');
|
||||
|
@ -23,10 +21,8 @@ class StaticController extends AbstractController
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IS_AUTHENTICATED_FULLY")
|
||||
*/
|
||||
#[Route(path: '/about', name: 'about', methods: ['GET'])]
|
||||
#[IsGranted('IS_AUTHENTICATED_FULLY')]
|
||||
public function aboutAction()
|
||||
{
|
||||
return $this->render(
|
||||
|
@ -38,10 +34,8 @@ class StaticController extends AbstractController
|
|||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("IS_AUTHENTICATED_FULLY")
|
||||
*/
|
||||
#[Route(path: '/quickstart', name: 'quickstart', methods: ['GET'])]
|
||||
#[IsGranted('IS_AUTHENTICATED_FULLY')]
|
||||
public function quickstartAction()
|
||||
{
|
||||
return $this->render(
|
||||
|
|
|
@ -34,10 +34,10 @@ class TagController extends AbstractController
|
|||
}
|
||||
|
||||
/**
|
||||
* @IsGranted("TAG", subject="entry")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/new-tag/{entry}', name: 'new_tag', methods: ['POST'], requirements: ['entry' => '\d+'])]
|
||||
#[IsGranted('TAG', subject: 'entry')]
|
||||
public function addTagFormAction(Request $request, Entry $entry, TranslatorInterface $translator)
|
||||
{
|
||||
$form = $this->createForm(NewTagType::class, new Tag());
|
||||
|
@ -83,10 +83,10 @@ class TagController extends AbstractController
|
|||
/**
|
||||
* Removes tag from entry.
|
||||
*
|
||||
* @IsGranted("UNTAG", subject="entry")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/remove-tag/{entry}/{tag}', name: 'remove_tag', methods: ['GET'], requirements: ['entry' => '\d+', 'tag' => '\d+'])]
|
||||
#[IsGranted('UNTAG', subject: 'entry')]
|
||||
public function removeTagFromEntry(Request $request, Entry $entry, Tag $tag)
|
||||
{
|
||||
$entry->removeTag($tag);
|
||||
|
@ -106,10 +106,10 @@ class TagController extends AbstractController
|
|||
/**
|
||||
* Shows tags for current user.
|
||||
*
|
||||
* @IsGranted("LIST_TAGS")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/tag/list', name: 'tag', methods: ['GET'])]
|
||||
#[IsGranted('LIST_TAGS')]
|
||||
public function showTagAction(TagRepository $tagRepository, EntryRepository $entryRepository)
|
||||
{
|
||||
$allTagsWithNbEntries = $tagRepository->findAllTagsWithNbEntries($this->getUser()->getId());
|
||||
|
@ -130,12 +130,12 @@ class TagController extends AbstractController
|
|||
/**
|
||||
* @param int $page
|
||||
*
|
||||
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
|
||||
* @IsGranted("LIST_ENTRIES")
|
||||
* @IsGranted("VIEW", subject="tag")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/tag/list/{slug}/{page}', name: 'tag_entries', methods: ['GET'], defaults: ['page' => '1'])]
|
||||
#[ParamConverter('tag', options: ['mapping' => ['slug' => 'slug']])]
|
||||
#[IsGranted('LIST_ENTRIES')]
|
||||
#[IsGranted('VIEW', subject: 'tag')]
|
||||
public function showEntriesForTagAction(Tag $tag, EntryRepository $entryRepository, PreparePagerForEntries $preparePagerForEntries, $page, Request $request)
|
||||
{
|
||||
$entriesByTag = $entryRepository->findAllByTagId(
|
||||
|
@ -170,11 +170,11 @@ class TagController extends AbstractController
|
|||
* Rename a given tag with a new label
|
||||
* Create a new tag with the new name and drop the old one.
|
||||
*
|
||||
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
|
||||
* @IsGranted("EDIT", subject="tag")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/tag/rename/{slug}', name: 'tag_rename', methods: ['POST'])]
|
||||
#[ParamConverter('tag', options: ['mapping' => ['slug' => 'slug']])]
|
||||
#[IsGranted('EDIT', subject: 'tag')]
|
||||
public function renameTagAction(Tag $tag, Request $request, TagRepository $tagRepository, EntryRepository $entryRepository)
|
||||
{
|
||||
$form = $this->createForm(RenameTagType::class, new Tag());
|
||||
|
@ -223,10 +223,10 @@ class TagController extends AbstractController
|
|||
/**
|
||||
* Tag search results with the current search term.
|
||||
*
|
||||
* @IsGranted("CREATE_TAGS")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/tag/search/{filter}', name: 'tag_this_search', methods: ['GET'])]
|
||||
#[IsGranted('CREATE_TAGS')]
|
||||
public function tagThisSearchAction($filter, Request $request, EntryRepository $entryRepository)
|
||||
{
|
||||
$currentRoute = $request->query->has('currentRoute') ? $request->query->get('currentRoute') : '';
|
||||
|
@ -258,11 +258,11 @@ class TagController extends AbstractController
|
|||
/**
|
||||
* Delete a given tag for the current user.
|
||||
*
|
||||
* @ParamConverter("tag", options={"mapping": {"slug": "slug"}})
|
||||
* @IsGranted("DELETE", subject="tag")
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/tag/delete/{slug}', name: 'tag_delete', methods: ['GET'])]
|
||||
#[ParamConverter('tag', options: ['mapping' => ['slug' => 'slug']])]
|
||||
#[IsGranted('DELETE', subject: 'tag')]
|
||||
public function removeTagAction(Tag $tag, Request $request, EntryRepository $entryRepository)
|
||||
{
|
||||
foreach ($tag->getEntriesByUserId($this->getUser()->getId()) as $entry) {
|
||||
|
|
|
@ -37,10 +37,9 @@ class UserController extends AbstractController
|
|||
|
||||
/**
|
||||
* Creates a new User entity.
|
||||
*
|
||||
* @IsGranted("CREATE_USERS")
|
||||
*/
|
||||
#[Route(path: '/users/new', name: 'user_new', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('CREATE_USERS')]
|
||||
public function newAction(Request $request, UserManagerInterface $userManager, EventDispatcherInterface $eventDispatcher)
|
||||
{
|
||||
$user = $userManager->createUser();
|
||||
|
@ -74,10 +73,9 @@ class UserController extends AbstractController
|
|||
|
||||
/**
|
||||
* Displays a form to edit an existing User entity.
|
||||
*
|
||||
* @IsGranted("EDIT", subject="user")
|
||||
*/
|
||||
#[Route(path: '/users/{id}/edit', name: 'user_edit', methods: ['GET', 'POST'])]
|
||||
#[IsGranted('EDIT', subject: 'user')]
|
||||
public function editAction(Request $request, User $user, UserManagerInterface $userManager, GoogleAuthenticatorInterface $googleAuthenticator)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($user);
|
||||
|
@ -117,10 +115,9 @@ class UserController extends AbstractController
|
|||
|
||||
/**
|
||||
* Deletes a User entity.
|
||||
*
|
||||
* @IsGranted("DELETE", subject="user")
|
||||
*/
|
||||
#[Route(path: '/users/{id}', name: 'user_delete', methods: ['DELETE'])]
|
||||
#[IsGranted('DELETE', subject: 'user')]
|
||||
public function deleteAction(Request $request, User $user)
|
||||
{
|
||||
$form = $this->createDeleteForm($user);
|
||||
|
@ -142,13 +139,10 @@ class UserController extends AbstractController
|
|||
/**
|
||||
* @param int $page
|
||||
*
|
||||
* @IsGranted("LIST_USERS")
|
||||
*
|
||||
* Default parameter for page is hardcoded (in duplication of the defaults from the Route)
|
||||
* because this controller is also called inside the layout template without any page as argument
|
||||
* @return Response
|
||||
*/
|
||||
#[Route(path: '/users/list/{page}', name: 'user_index', methods: ['GET'], defaults: ['page' => 1])]
|
||||
#[IsGranted('LIST_USERS')] // Default parameter for page is hardcoded (in duplication of the defaults from the Route)
|
||||
public function searchFormAction(Request $request, UserRepository $userRepository, $page = 1)
|
||||
{
|
||||
$qb = $userRepository->createQueryBuilder('u');
|
||||
|
|
Loading…
Reference in a new issue