A section can not be removed if it's assigned to some contents OR it is used in some roles.
Permissions UI granularity
Policy "Edit limitations" button should be disabled when there is nothing to edit
Is this really blocked by EZP-23738 "Permissions UI granularity"? The section controller is already checking the number of content objects assigned to each section, we just need to add the count for roles using each section. The gateway has a `countContentObjectsInSection($id)`, it should be easy enough to add a `countRolesUsingSection($id)`. What say you [~firstname.lastname@example.org]...?
It's been a while And my code has been refactored since I opened this issue.
You can have a look with today's architecture. Just keep in mind the performances as this is a list and it can contain a certain number of items so the count must be quite optimized.
Right, it's nearly time for the 1st year anniversary Ok, I'll try out my theory. The section list isn't paginated yet, but that's a separate story and fixing this bug now won't make that any harder I think.
Merged in master:
Tested and approved by QA for master.