Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

#136 - Disable registration (Christmas bonus specials: βœ“#168 && 𐄂 #169) #170

Merged
merged 3 commits into from
Jan 3, 2018

Conversation

HcsOmot
Copy link
Collaborator

@HcsOmot HcsOmot commented Dec 25, 2017

In order to prevent visitors from creating user accounts on website
And provide administrators with ability to create accounts for new administrators
As developers
We need to restrict the access to registration page only to administrators

This PR will allow access to registration page to administrators only, and will add behat scenarios and step implementations for this new rule.

Coincidentally, this also enables closing of #168, because restricting access to registration page caused the removal of tests for registration for new users, but created problems with new registration confirmation (see #169)

Closes #136 and #168

Only administrators can register new users with the system.
Minimal authorization level needed for accessing registration pages
is ROLE_ADMIN.
Considerig that since commit fa31cfe1ee9a only users with at least
ROLE_ADMIN authorization level can access the registration page, tests
needed to be changed in order to reflect this new state.

This will modify the tests for accessing registration page, implementing
new steps to handle different users trying to gain access to registration
page.
This commit will resolve two problems:

1. Use valid login credential for admin
2. Remove execution order dependency for fos:user tests

Because only administrators can have accounts on our application, we
can use an admin account to test login and profile page accessibility.

Since we've added an admin user to data fixtures, we can now use that
data in fos:user tests for login/profile/logout, and remove the
ordering dependency between features (up until now we had to run
registration scenarios first, and only then could we run login/profile
and logout scenarios).
@HcsOmot HcsOmot requested a review from msvrtan December 25, 2017 11:41
Copy link
Contributor

@msvrtan msvrtan left a comment

Choose a reason for hiding this comment

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

Weeeee nice one! πŸ‘ πŸŽ‰

@HcsOmot HcsOmot merged commit b014312 into zgphp:master Jan 3, 2018
@HcsOmot HcsOmot deleted the 136-disable-registration branch January 3, 2018 15:58
@HcsOmot HcsOmot mentioned this pull request Jan 9, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants