I am developing a new block and need to hide "Configure block" from block`s dropdown menu like on this picture
I override block`s function user_can_edit, which checks permission in system context
$syscontext=context_system::instance();
if (has_capability('moodle/site:config', $syscontext)) {
return true;
} else {
return false;
}
But an authenticated user still can see this menu item. How can I hide this item for non admin users?