Re: Determine whether current user can edit specified page
On Mon, Mar 07, 2011 at 04:09:52PM -0500, Jim Safley wrote:
> Using the API, what is the best way to determine whether the current
> user can edit a specified page? I could use:
> to detect an "Action 'edit' is not allowed for the current user"
> warning, but this doesn't account for users with edit rights who
> attempt to edit a protected page.
I don't know if it's the best way, but you can retrieve the user's
access rights with:
And you can query the protection of the page when retrieving the token: