Skip to main content
deleted 1 characters in body
Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337

The block module is not required by core; just go to mysite.com/admin/modules and disable it, if you don't want to use it in your site.

EDIT to address your updated question. This code should do the trick. It will deny access directly to the blocks admin overview page, but will still allow access to the add block page.

function mymodule_menu_alter(&$items) {
  // Deny access to the blocks overview page.
  $items['admin/structure/blocks']['accessblock']['access callback'] = FALSE;

  // Explicitly allow access to the block add page
  $items['admin/structure/block/add']['access callback'] = 'user_access';
  $items['admin/structure/block/add']['access arguments'] = array('required permissions');
}

The block module is not required by core; just go to mysite.com/admin/modules and disable it, if you don't want to use it in your site.

EDIT to address your updated question. This code should do the trick. It will deny access directly to the blocks admin overview page, but will still allow access to the add block page.

function mymodule_menu_alter(&$items) {
  // Deny access to the blocks overview page.
  $items['admin/structure/blocks']['access callback'] = FALSE;

  // Explicitly allow access to the block add page
  $items['admin/structure/block/add']['access callback'] = 'user_access';
  $items['admin/structure/block/add']['access arguments'] = array('required permissions');
}

The block module is not required by core; just go to mysite.com/admin/modules and disable it, if you don't want to use it in your site.

EDIT to address your updated question. This code should do the trick. It will deny access directly to the blocks admin overview page, but will still allow access to the add block page.

function mymodule_menu_alter(&$items) {
  // Deny access to the blocks overview page.
  $items['admin/structure/block']['access callback'] = FALSE;

  // Explicitly allow access to the block add page
  $items['admin/structure/block/add']['access callback'] = 'user_access';
  $items['admin/structure/block/add']['access arguments'] = array('required permissions');
}
added 598 characters in body
Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337

The block module is not required by core; just go to mysite.com/admin/modules and disable it, if you don't want to use it in your site.

EDIT to address your updated question. This code should do the trick. It will deny access directly to the blocks admin overview page, but will still allow access to the add block page.

function mymodule_menu_alter(&$items) {
  // Deny access to the blocks overview page.
  $items['admin/structure/blocks']['access callback'] = FALSE;

  // Explicitly allow access to the block add page
  $items['admin/structure/block/add']['access callback'] = 'user_access';
  $items['admin/structure/block/add']['access arguments'] = array('required permissions');
}

The block module is not required by core; just go to mysite.com/admin/modules and disable it, if you don't want to use it in your site.

The block module is not required by core; just go to mysite.com/admin/modules and disable it, if you don't want to use it in your site.

EDIT to address your updated question. This code should do the trick. It will deny access directly to the blocks admin overview page, but will still allow access to the add block page.

function mymodule_menu_alter(&$items) {
  // Deny access to the blocks overview page.
  $items['admin/structure/blocks']['access callback'] = FALSE;

  // Explicitly allow access to the block add page
  $items['admin/structure/block/add']['access callback'] = 'user_access';
  $items['admin/structure/block/add']['access arguments'] = array('required permissions');
}
added 1 characters in body
Source Link
avpaderno
  • 97.9k
  • 15
  • 164
  • 284

The block module is not required by core,core; just go to mysite.com/admin/modules and disable it, if you don't want to use it in your site.

The block module is not required by core, just go to mysite.com/admin/modules and disable it if you don't want to use it in your site.

The block module is not required by core; just go to mysite.com/admin/modules and disable it, if you don't want to use it in your site.

Source Link
Clive
  • 167.9k
  • 19
  • 303
  • 337
Loading