Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnpublisherID in version History #3746

Closed
blpraveen opened this issue Dec 30, 2014 · 5 comments
Closed

UnpublisherID in version History #3746

blpraveen opened this issue Dec 30, 2014 · 5 comments

Comments

@blpraveen
Copy link

Currently the Version History does not show who unpublished or deleted the page. Can we have the columns to save unpublisherID in the version history table

@willmorgan
Copy link
Contributor

You can extend the Versioned object for this purpose, add the Unpublisher as a Member relationship, and hook in to onBeforeVersionedPublish to assign it.

@dhensby
Copy link
Contributor

dhensby commented Dec 31, 2014

Perhaps a less explicit way (and saving adding a column only for the unpublish event) would be to save a record for unplubish but use the PublisherID as the implied unpublisher? I see that would have a more wide reaching usefulness

@blpraveen
Copy link
Author

Thanks Will & Daniel,

We cannot know who unpublished the page or deleted. It necessary to track malicious user trying to unpublish the page.

I'm not sure whether it's right but what I found that onBeforeVersionedPublish is called on publish or save draft. Instead it should create new version on deleteFromStage or on delete.

Thanks

@willmorgan
Copy link
Contributor

We cannot know who unpublished the page or deleted

You can access this through Member::currentUser()

Instead it should create new version on deleteFromStage or on delete

You can also hook in to the onBeforeRollback event.

https://github.com/silverstripe/silverstripe-framework/blob/3.1/model/Versioned.php#L1217

If you also read the source of DataObject.php, you can get an idea of some of the other extension points available to you.

@kinglozzer
Copy link
Member

Feature request, can be implemented via extensions as described above

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants