WIP: [CFM-861-tests] Add Behat tests for permissions. #1494
Conversation
Update selector - remove condition that never occurs
| $target_access = og_user_access($group_type, $group['gid'], "create $node_type content"); | ||
| // Any member can edit a wiki page unless a power user has changed it | ||
| // specifically for a specific node. | ||
| if (!empty($this->entity->nid) && $node_type == 'wiki_page') { |
There was a problem hiding this comment.
Not sure about this one ....
There was a problem hiding this comment.
As I see it at code, selector is activated at og.module hook_node_access(), line 523.
This activation is inside following if (line 501):
if ($op == 'create' && og_is_group_content_type('node', $type))
This means that selector is activated only when creating group content. Right?
There was a problem hiding this comment.
It fixed the bug we had, see travis for 84154e0
There was a problem hiding this comment.
This commit doesn't have the !empty($this->entity->nid) condition.
empty($this->entity->nid) will return TRUE when creating node, so
!empty($this->entity->nid) will always return FALSE, if we create a node.
There was a problem hiding this comment.
but here you've removed part of it ...
There was a problem hiding this comment.
Restored the condition
…ess can not be altered if it's missing.
| | mariecurie | /node/add/event | | ||
| | mariecurie | /node/add/document | | ||
| | mariecurie | /node/add/discussion | | ||
| | mariecurie | /node/add/wiki-page | |
| Examples: | ||
| | user | path | | ||
| | isaacnewton | /draft/node/add/photoalbum | | ||
| | isaacnewton | /published/node/add/photo | |
There was a problem hiding this comment.
this should be /draft/... instead of /published/... for lines 251-272
| | mariecurie | /published/node/add/document | | ||
| | mariecurie | /published/node/add/discussion | | ||
| | mariecurie | /published/node/add/wiki-page | | ||
|
|
There was a problem hiding this comment.
we also need to update the path to /draft/ instead of /pending/ for all lines from 251 to 272
There was a problem hiding this comment.
Fixed. Also, lines 194-216.
| | mariecurie | /published/node/add/document | | ||
| | mariecurie | /published/node/add/discussion | | ||
| | mariecurie | /published/node/add/wiki-page | | ||
|
|
There was a problem hiding this comment.
we also need to update the path to /draft/ instead of /pending/ for all lines from 307 to 328
| When I change access of group "Published group" to "Public" | ||
| Then I am an anonymous user | ||
| And I go to "published" | ||
| And I should see "Please log in" |
There was a problem hiding this comment.
wrong - a visitor can access and view all contents in a published public group - he does not need to login
to create content though, he needs to become a member via combined workflow
| When I change access of group "Archived group" to "Public" | ||
| Then I am an anonymous user | ||
| And I go to "archived" | ||
| And I should see "Please log in" |
There was a problem hiding this comment.
wrong - a visitor can access and view all contents in a published archived group - he does not need to login
Archived groups are read only so visitors cannot request membership
| | mariecurie | /deleted/node/add/document | | ||
| | mariecurie | /deleted/node/add/discussion | | ||
| | mariecurie | /deleted/node/add/wiki-page | | ||
|
|
There was a problem hiding this comment.
no we agreed with Aki this AM that both pending and deleted groups would prevent any user from creating content - so please add lines 716 to 721 in the scenario below, described under line 724
| | mariecurie | /deleted/node/add/document | | ||
| | mariecurie | /deleted/node/add/discussion | | ||
| | mariecurie | /deleted/node/add/wiki-page | | ||
|
|
There was a problem hiding this comment.
no we agreed with Aki this AM that deleted groups would prevent any user from creating content - so please delete scenario described under 765 and add lines 772 to 777 in the scenario described under line 780
| | mariecurie | /deleted/node/add/document | | ||
| | mariecurie | /deleted/node/add/discussion | | ||
| | mariecurie | /deleted/node/add/wiki-page | | ||
|
|
There was a problem hiding this comment.
no we agreed with Aki this AM that deleted groups would prevent any user from creating content - so please delete scenario described under 821 and add lines 828 to 833 in the scenario described under line 836
|
As a general comment for the create content permissions... |
|
@anvmn ^^ |
|
@anvmn
- INSTALL_PROFILE=1
BEHAT_TAG="permission"
CODE_REVIEW=0
SIMPLETEST=0
# Run tests for the permission tag.
if [ "$BEHAT_TAG" = "permission" ]; then
./bin/behat --tags='@permission&&~@wip'
fi |
|
Closing in favor of #1523 |
Derives from #1445