Issue #2931605 by jnettik, joshua.roberson: Contextual Links do not respect permissions
Routing for edit and delete forms don't work and having routes setup broke the on page edit links. Removing the routes and doing the access checks in hooks fixed everything.
Fixed a bug that allowed a person to edit block content through "Quick Edit" if they had the "Administer blocks" permission but did not have the related "Edit" permission.
Removed the required "Administer blocks" permission from everything except the "Custom block library" views page.
On the "Add custom block" page, restricted list based on "Create" permissions so there is less confusion.
On the "Custom block library" page, removed the "Block Description" column edit links so they appear as plain text. The edit links were always present even if the user didn't have edit permissions which could cause confusion. The "Operations" column edit links should be used instead which are permission based.
Use a hook that is earlier in the flow. This should execute a little faster since the "ViewExecutable" object that is being modified should be smaller. You need to run "drush cr" to rebuild cache so the new hook works.
Removed the "administer block content" permission which was not needed since there are already "Create", "Edit", and "Delete" permissions for each block content type. This better mimics the "Node" permissions.