Forums / General / How to disable access to content/history

How to disable access to content/history

Author Message

Nicolas Panau

Wednesday 18 May 2011 9:10:21 am

Hello eZ community,

I have a content which is editable by members.
When a user edit the content, he is redirected (lastaccessuri) to the previous page (OK) and the content is immediatly updated.

If the user hits the back button of his browser, he is brought back to the edit view.
The problem is that he is in fact editing the previous draft, that has been published meanwhile. When the user hits publish, ezpublish brings him to content/history.

Is there a way to avoid this? I don't want my users to see this view...

Thanks

www.umanit.fr

Marko Žmak

Wednesday 18 May 2011 11:25:27 pm

Using the back button was awlays a problem, web applications are just not designed for such usage. SO the best solution would be to tell the users not to use the back button in such cases.

But, since you cannot always tell this to the user, you could override the template which is used for displaying history and put whatever you want in it. Possbily an error message.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Nicolas Panau

Thursday 19 May 2011 7:25:45 am

Thanks Marko for your answer.

I was hopping a solution like EditDirtyObjectAction, but never mind, i'll try the teaching solution, and at worst the override solution...!

www.umanit.fr

Marko Žmak

Thursday 19 May 2011 11:33:22 am

Well, the solution like EditDirtyObjectAction is not doable here, because your users are trying to edit a version of the object that has already been published.

But you could try to use the redirect operators:

  • http://projects.ez.no/redirect_operators

in the history override template to redirect users to the edit page of that object. Sounds like it could work.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Nicolas Panau

Friday 20 May 2011 1:30:51 am

"

But you could try to use the redirect operators:

  • http://projects.ez.no/redirect_operators
"

Sounds like a nice idea. Thanks again.

www.umanit.fr