[Hugo, Mukiza] fix edit permission on sections and subsections and refactored to remove a long predicate in the templates