Control access to a custom blocks edit page I have a small module which creates and adds some custom settings for a block. Now I would like to control access to this blocks edit page. All users should be able to display the block, while changing the actual the configuration only should be available to certain users. 
Since I am not able to use hook_permission() I am not really sure how to best solve this so any help would be much appreciated.

Edit

I have tried this without any success:

function MYMODULE_block_info() {
  return array(
    'MYBLOCK' =&gt; array(
    'info' =&gt; t('MYBLOCK'),
    'cache' =&gt; DRUPAL_CACHE_GLOBAL,
    ),
  );
}


When I clear the cache and tries to go to the blocks edit page the url changes but nothing happens. It is like I am still standing on the block overview page?

function MYMODULE_permission() {
  return array(
    'administer MYBLOCK' =&gt; array(
    'title' =&gt; t('Administer MYBLOCK'),
    'description' =&gt; t('Administer MYBLOCK settings.'),
   ),
  );
}

function MYMODULE_menu_alter(&amp;$items) {
  $items['admin/structure/block/manage/MYMODULE/MYBLOCK/configure']['access arguments'] = array('administer MYBLOCK');
}


Edit

If I use user_access() in hook_block_configure() I almost achieve what I want. I don't know if this would be a valid way to solve this problem:

function MYMODULE_block_configure($delta = '') {
  $form = array();
  if ($delta == 'MYBLOCK') {
    if (!user_access('administer MYBLOCK')) {
      drupal_set_message(t('You are not allowed to edit the @block block.', array('@block' =&gt; $delta)), WATCHDOG_WARNING);
      drupal_goto('admin/structure/block/manage');
      drupal_exit();
    }
    // Setup form for the block here.
  }
  return $form;
}
/**
 * Implements hook_permission().
 */
function my_module_permission() {
  return [
    'my_module_custom_permission' =&gt; [
      'title' =&gt; t('My Module Custom Permission'),
      'description' =&gt; t('Explain what this permission allows the user to do.'),
    ],
  ];
}

/**
 * Implements hook_menu_alter().
 */
function my_module_menu_alter(&amp;$items) {
  $items['admin/structure/block/manage/block/5/configure']['access arguments'] = ['my_module_custom_permission'];
}

If you use the code above, follow the steps below.
Steps

Replace all instances of 'my_module_custom_permission' to a machine name that makes sense.
Update the 'title' and 'description' for the custom permission.
Replace all instances of the word 'my_module' with your module's machine name.
Change the $items path from what I have to the block path you are trying to update.

Important to note
If the block you are editing was created from the frontend of the Drupal website, then it can be deleted. If it gets deleted and then recreated, the block's ID will change. Which in turn changes the path to the block's configuration page.
Testing
Make sure to give your test user the permission we've just made and make sure they can edit the block configuration. Also, test a user who does not have the permission and make sure they can not edit the block configuration.