Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fillpdf
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
fillpdf
Commits
57e1dd4e
"..._patterns/ist-git@git.uwaterloo.ca:wcms/uw_wcms_gesso.git" did not exist on "856fd2d36bcd97719ef08e37f996c3feff850e7a"
Commit
57e1dd4e
authored
9 years ago
by
Kevin Kaland
Browse files
Options
Downloads
Patches
Plain Diff
Issue #2359213: Stub out actually checking access.
parent
45f62b27
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/FillPdfAccessController.php
+45
-6
45 additions, 6 deletions
src/FillPdfAccessController.php
with
45 additions
and
6 deletions
src/FillPdfAccessController.php
+
45
−
6
View file @
57e1dd4e
<?php
<?php
/**
/**
* @file
* @file
* Contains \Drupal\fillpdf\FillPdfAccessController.
* Contains \Drupal\fillpdf\FillPdfAccessController.
*/
*/
namespace
Drupal\fillpdf
;
namespace
Drupal\fillpdf
;
use
Drupal\Core\Access\AccessResult
;
use
Drupal\Core\Access\AccessResult
;
use
Drupal\Core\DependencyInjection\ContainerInjectionInterface
;
use
Symfony\Component\DependencyInjection\ContainerInterface
;
use
Symfony\Component\HttpFoundation\RequestStack
;
class
FillPdfAccessController
{
class
FillPdfAccessController
implements
ContainerInjectionInterface
{
/** @var FillPdfLinkManipulatorInterface $linkManipulator */
protected
$linkManipulator
;
/** @var RequestStack $requestStack */
protected
$requestStack
;
/** @var FillPdfContextManagerInterface $contextManager */
protected
$contextManager
;
public
function
__construct
(
FillPdfLinkManipulatorInterface
$link_manipulator
,
FillPdfContextManagerInterface
$context_manager
,
RequestStack
$request_stack
)
{
$this
->
linkManipulator
=
$link_manipulator
;
$this
->
contextManager
=
$context_manager
;
$this
->
requestStack
=
$request_stack
;
}
/**
* {@inheritDoc}
*/
public
static
function
create
(
ContainerInterface
$container
)
{
return
new
static
(
$container
->
get
(
'fillpdf.link_manipulator'
),
$container
->
get
(
'fillpdf.context_manager'
),
$container
->
get
(
'request_stack'
));
}
public
function
checkLink
()
{
$context
=
$this
->
linkManipulator
->
parseLink
(
$this
->
requestStack
->
getCurrentRequest
());
// TODO: samples can be viewed by admins
if
(
$context
[
'sample'
])
{
// ...
}
$entities
=
$this
->
contextManager
->
loadEntities
(
$context
);
foreach
(
$entities
as
$entity_type
=>
$entity_objects
)
{
// If there are any entities in the context that the user can't view,
// deny access.
// TODO: return AccessResult:forbiddenIf accordingly
}
function
checkLink
()
{
// TODO: Actually do access checking here
return
AccessResult
::
allowedIf
(
TRUE
);
return
AccessResult
::
allowedIf
(
TRUE
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment