Clean up chapters controller filters

Description

Some of the before_filters in chapters_controller are missing actions or are filtering different actions for no apparent reasons. This can result in some strange issues:

  1. Banned/suspended users can post and delete chapters, but not create or edit.

    1. Abuse says banned and suspended users should not be able to post, create, edit, or delete chapters

  2. There's a comment saying admins should be able to delete chapters, but later chapter deletion is restricted to owners only.

    1. Abuse would love for admins to be able to delete chapters, since sometimes they currently end up deleting entire works due to commercial content (e.g. donation links) in one chapter

  3. Trying to delete a chapter while logged out results in a redirect to the work rather that to the login page (pending test in for this.

  4. The filters indicate that non-work owners can post works, though code below actually prevents this. (pending test in for this).

The filters should be cleaned up so that they make sense and prevent/allow the correct actions.

Activity

Show:
Sarken
July 16, 2017, 2:50 AM

Edited to reflect Abuse's wishes for items 1 and 2! If 2 is complicated, you can break it out into a separate issue and just tackle the other items.

Sarken
July 16, 2017, 1:35 AM

Checking with Abuse staff to learn what the desired behavior is for 1 and 2

Assignee

Unassigned

Reporter

cresenne

Roadmap

Works

Priority

Medium

Affects versions

Fix versions

None

Components

BackEnd

Difficulty

Medium

Milestone

Internal 0.9