forked from wallabag/wallabag
Add IsGranted to ExportController
This commit is contained in:
@ -11,6 +11,7 @@ class MainVoter extends Voter
|
||||
public const LIST_ENTRIES = 'LIST_ENTRIES';
|
||||
public const CREATE_ENTRIES = 'CREATE_ENTRIES';
|
||||
public const EDIT_ENTRIES = 'EDIT_ENTRIES';
|
||||
public const EXPORT_ENTRIES = 'EXPORT_ENTRIES';
|
||||
public const LIST_SITE_CREDENTIALS = 'LIST_SITE_CREDENTIALS';
|
||||
public const CREATE_SITE_CREDENTIALS = 'CREATE_SITE_CREDENTIALS';
|
||||
|
||||
@ -27,7 +28,7 @@ class MainVoter extends Voter
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!\in_array($attribute, [self::LIST_ENTRIES, self::CREATE_ENTRIES, self::EDIT_ENTRIES, self::LIST_SITE_CREDENTIALS, self::CREATE_SITE_CREDENTIALS], true)) {
|
||||
if (!\in_array($attribute, [self::LIST_ENTRIES, self::CREATE_ENTRIES, self::EDIT_ENTRIES, self::EXPORT_ENTRIES, self::LIST_SITE_CREDENTIALS, self::CREATE_SITE_CREDENTIALS], true)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -40,6 +41,7 @@ class MainVoter extends Voter
|
||||
case self::LIST_ENTRIES:
|
||||
case self::CREATE_ENTRIES:
|
||||
case self::EDIT_ENTRIES:
|
||||
case self::EXPORT_ENTRIES:
|
||||
case self::LIST_SITE_CREDENTIALS:
|
||||
case self::CREATE_SITE_CREDENTIALS:
|
||||
return $this->security->isGranted('ROLE_USER');
|
||||
|
||||
Reference in New Issue
Block a user