7eface28ff
To get to the wiki edit page, the user needs update or update_content rights on the page. Both of these permissions require WikiPage#can_edit_page? to return true. This method returns false if locked_for?(user) (there's a few exceptions to this noted below). Thus, users for whom the page is locked can't load the edit page, so there's no reason to check if its locked again in the erb. There's a few exceptions to WikiPage#can_edit_page?. It'll return true (and grant access to the page) if the user has the Course manage_wiki_update permission, or if the user is a course admin. The page will never be locked for course admins though, so the lock_explanation wouldn't show anyway. And the manage_wiki_update permission cannot be granted to non-admin roles. flag = none Test plan: - Go to a wiki page edit page - Expect the header to look normal (there's no functional changes here) Change-Id: I3c06ae4e5ae79f846ec2cd8cbd8dafd26ce7ec36 Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/347472 Reviewed-by: Robin Kuss <rkuss@instructure.com> QA-Review: Robin Kuss <rkuss@instructure.com> Product-Review: Jackson Howe <jackson.howe@instructure.com> Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com> |
||
---|---|---|
.. | ||
edit.html.erb | ||
index.html.erb | ||
revisions.html.erb | ||
show.html.erb |