rails-school / school

Rails School San Francisco Official Website
https://www.railsschool.org
MIT License
19 stars 32 forks source link

Fix authentication of edit and delete #220

Closed mmezher closed 8 years ago

mmezher commented 8 years ago

After testing previous pull request, some features, such as deleting a poll, were still doable by users. Fixed constraints so that admin status is checked rather than managing polls. This also fixed the rspec admin test, which had been failing previously.

gkop commented 8 years ago

Rad! The hound complaints seem valid mostly, would you fix those and merge please?

mmezher commented 8 years ago

Unsure why the admin test has again stopped passing. The rspec file and all other parts other than proper formatting stayed the same.

mmezher commented 8 years ago

Strange behavior. All users can destroy polls still, but publish button is disabled, edit does not work, new poll does not show up nor work via direct url, and users still see all buttons. However, non-users can no longer access polls viewing, so their access to destroying polls has been disabled. Still need to fix authorization of destruction. Will need to include another rspec test for users/admin deleting in next pull request.