“You don’t have permission to do that”
One of the most frustrating thing with WordPress is when you are happily moving along, and you come to a comment, or an old post, or an unused category - something like that - and you want to delete it. You click the “Delete: button associated with that link, and nothing happens. You stare at the screen for a bit, maybe hit the button a couple more times to see if maybe it was a weird glitch or something, then you notice it. A little message at the bottom of the screen.
“You don’t have permission to do that.”
Infuriating. You’re logged in as the administrator, and really there’s no higher level. How can *you* NOT have permission to do that? *You* are the one who supplies permissions for anyone else using WordPress, but here it is - some unnamed gremlin with no face, mocking you with your lack of permissions on your own installation where normally, you are king.
Now, there’s a lot of stuff in the forums on this subject. Many times, the simplest fix is to simply reassert your administrative status. Create a new user, and assign it admin status. Log out, and log back in with the new username, and you should have permissions again.
But what if this doesn’t work? In the few times I’ve had this happen to me, the “reassertion” trick has never worked. But I have found a trick that does.
In 2.0.x, you need to go to wp-includes.pluggable-functions.php. Lines 241-247 look like so:
$cookie = explode('; ', urldecode(empty($_POST['cookie']) ? $_GET['cookie'] : $_POST['cookie']));
// AJAX scripts must pass cookie=document.cookie
foreach ( $cookie as $tasty ) {
if ( false !== strpos($tasty, USER_COOKIE) )
$user = urldecode(substr(strstr($tasty, ‘=’), 1)); // Nasty double encoding
if ( false !== strpos($tasty, PASS_COOKIE) )
$pass = urldecode(substr(strstr($tasty, ‘=’), 1));
}
Simply comment out that section, and replace it with this:
$user = $_COOKIE[USER_COOKIE];
$pass = $_COOKIE[PASS_COOKIE];
Problem solved.
(In the case of 2.1.x, I don’t know what the line numbers are, but it’s the wp-includes/pluggable.php file, and it’s the same code. I know it’s in the same general area - give or take a few line numbers.)



I have problem whenever i comment on any wordpress site it says Your comment is awaiting moderation can u help to get rid of this
Spoken on February 11th, 2008 at 6:51 am