Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjust to workflow moved to security #25

Merged
merged 1 commit into from
Jul 15, 2013
Merged

adjust to workflow moved to security #25

merged 1 commit into from
Jul 15, 2013

Conversation

dbu
Copy link
Member

@dbu dbu commented Jun 22, 2013

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? -
Fixed tickets
License MIT
Doc PR -

Adjust to symfony-cmf/core-bundle#59

@dbu
Copy link
Member Author

dbu commented Jun 24, 2013

as discovered in the core bundle, this will fail if there is no firewall configured. we could also inject the workflow service from core, but only if it is enabled. we probably need something here to make the check optional.

ViewHandlerInterface $viewHandler = null,
DocumentManager $dm,
PublishWorkflowCheckerInterface $pwfc
SecurityContextInterface $securityContext
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we allow null here and skip the check if no security context is defined?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this were optional I would prefer it to be a setter. Though, I'm +0 on making SecurityContext optional, in I think the security component is inevitable in most cases.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah. i created symfony-cmf/core-bundle#69 - what
do you think about that, would this be a solution?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think makes some sense in terms of cleaner code, but doesn't help with getting rid of dependencies.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I am +0 for dependencies here, and probably +1 for the PWFAlways checker, although I have never used anything like that so not really in a position to express a strong opinion.

@dbu
Copy link
Member Author

dbu commented Jul 14, 2013

this is adjusted to the now merged CoreBundle. @dantleech would be great if you can review this until tomorrow so we can tag the release

{
$post = $contentDocument;

if (true !== $this->pwfc->checkIsPublished($post)) {
if (true !== $this->securityContext->isGranted('VIEW', $post)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if VIEW is the best name. VIEW_UNPUBLISHED?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that name is part of the pr on core. VIEW is the right thing because
that plays well with checks if a user is allowed to do the VIEW
operation. we do not check the permission if the user is allowed to VIEW
unpublished documents, just if he is allowed to VIEW this document.

everything else is handled in the publish workflow checker.

dbu added a commit that referenced this pull request Jul 15, 2013
adjust to workflow moved to security
@dbu dbu merged commit a90e3e2 into master Jul 15, 2013
@dbu dbu deleted the workflow-security branch July 15, 2013 18:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants