Jump to content

Topic on Project:Support desk

Larslaki (talkcontribs)

Hello I'm trying to use the mediawiki api using R.

I have tried to delete a page in my wiki. I got an error message saying that I'm not an administrator. But this is not the case.  A fresh installation also produced the same result. The administrator account seems to be assigned only limited rights.

If I assign the 'delete' option to the sysop group in the localsettings, this is not applied. However, if I assign delete for all user groups (*) it works. But this is too insecure as solution.

Can someone please help me or give me hints on how to solve this.

Bawolff (talkcontribs)

Are you sure that your account is actually an administrator? If you go to Special:preferences (or Special:listusers ) what groups does it say you are a member of?


If you are using the api, are you using either bot passwords or oauth? If so you need to take grants into account.

Larslaki (talkcontribs)

Thank you for your help!

Yes it is administrator. I'm not using bot passwords. I used action=login with password and username for an user which is administrator.

It seems that the login via api is somehow limiting the rights. If I'm checking the user information getting after API login it is also described as admin but with a different set of rights (only 10 including the right to edit but not delete).

How to login and keeping the rights which are visible for admins on the User group rights page?

Bawolff (talkcontribs)

Do you have any auth related extensions installed? When logged in via the api is the set of implicit groups different than a normal login? (E.g. check with api.php?action=query&meta=userinfo&uiprop=rights|groups|implicitgroups ). Do you have any groups setup that revoke rights (check on Special:ListGroupRights ). You could also check if the rights you have correspond exactly to something on Special:listGrants, although based on your description grants shouldnt be in use.

Larslaki (talkcontribs)

it seems like. that is the output:

{

"batchcomplete": "",

"query": {

   "userinfo": {

       "id": 0,

       "name": "84.140.150.49",

       "anon": "",

       "groups": [

           "*"

       ],

       "implicitgroups": [

           "*"

       ],

       "rights": [

           "read",

           "edit",

           "createpage",

           "createtalk",

           "writeapi",

           "viewmywatchlist",

           "editmywatchlist",

           "viewmyprivateinfo",

           "editmyprivateinfo",

           "editmyoptions"

       ]

   }

}

}

This is the same list I get within R after login and asking for user rights for the user.

But I'm not clear were it comes from. I had used some type of extension but not using them anymore and deleted them. Could they have changed the rights beyond their use?

Bawolff (talkcontribs)

That output is saying you are not logged in (See the word "anon" in it), which would explain why you don't have the rights.

TheDJ (talkcontribs)

> I used action=login with password and username.

I'm pretty sure, you need to use a cookiejar to keep track of cookies between requests if you use this flow. Not having one would explain the behaviour described.

Larslaki (talkcontribs)

ah ok now I tried again and I was surely logged in and used your code frome above, The result now is different and it showes me all option for me as administrator. That means that my login via R and API is not working properly or the cookies are not managed well as the second answer suggest.

Than I will try to figure out how to loggin properly. If you have any suggestions for this I would be very grateful!

Thank you so far a lot!!!!!

Reply to "group permission"