You do not have sufficient permissions to access this page

Updated a friends blog (new Akismet) and then wanted to add a plugin.

Adding the plugin went ok, but trying to activate it I got the following error

“You do not have sufficient permissions to access this page”

Looked in the database and at permissions, googled all over the place. Loads of 5 years old answers.

Hey, Google, you need to update your databases!!!

Wanted to check if the theme was the issue and found that there was no “Edit” link.

Another round of googling and I came across this on

Disable File Editing
The WordPress Dashboard by default allows administrators to edit PHP files, such as plugin and theme files. This is often the first tool an attacker will use if able to login, since it allows code execution. WordPress has a constant to disable editing from Dashboard. Placing this line in wp-config.php is equivalent to removing the ‘edit_themes’, ‘edit_plugins’ and ‘edit_files’ capabilities of all users:

define(‘DISALLOW_FILE_EDIT’, true);

I changed it to

define(‘DISALLOW_FILE_EDIT’, false);

and Edit menu appeared and I could start the plugins.

Since I will probably forget everything about this in a few days, I added it here, so I can find it again.