# Is it possible to protect some Objects in a page but not others?

**URL:** <https://forum.xwiki.org/t/is-it-possible-to-protect-some-objects-in-a-page-but-not-others/339>\
**Category:** Help / Discuss\
**Tags:** rights\
**Created:** [July 21, 2017, 8:28am UTC](https://forum.xwiki.org/t/is-it-possible-to-protect-some-objects-in-a-page-but-not-others/339 "2017-07-21T08:28:46Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ben.megson](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@ben.megson](https://forum.xwiki.org/u/ben.megson)\
**Post date:** [July 21, 2017, 8:28am UTC](https://forum.xwiki.org/t/is-it-possible-to-protect-some-objects-in-a-page-but-not-others/339/1 "2017-07-21T08:28:46Z")

</div>

Hello,

Following on from [this thread](https://forum.xwiki.org/t/prevent-users-from-being-able-to-change-or-view-page-rights/325). Does anyone know if it’s possible to protect an object on a page but not others? By protect, I mean limit rights based on a group or just to administrators.

If this turns out not to be possible, I’d like to suggest it would be very useful in environments that are security paranoid! @evalica, would this fit in with your Rights Improvements discussion?

Ben

---

<div class="post-metadata">

**Author:** ![evalica](https://forum.xwiki.org/user_avatar/forum.xwiki.org/evalica/32/4_2.png) [@evalica](https://forum.xwiki.org/u/evalica)\
**Post date:** [July 22, 2017, 7:45am UTC](https://forum.xwiki.org/t/is-it-possible-to-protect-some-objects-in-a-page-but-not-others/339/2 "2017-07-22T07:45:48Z")

</div>

Currently it’s not possible to have rights for Objects. This would be interesting, but since it’s more of a new feature, it doesn’t really fit into the Rights improvements discussion, which covers mostly the existing rights.

I guess you can do it by creating a new custom right. Not sure how complex that would be from a technical point of view.

---

<div class="post-metadata">

**Author:** ![tmortagne](https://forum.xwiki.org/user_avatar/forum.xwiki.org/tmortagne/32/4930_2.png) [@tmortagne](https://forum.xwiki.org/u/tmortagne)\
**Post date:** [July 22, 2017, 8:52am UTC](https://forum.xwiki.org/t/is-it-possible-to-protect-some-objects-in-a-page-but-not-others/339/3 "2017-07-22T08:52:03Z")

</div>

It depends what is your need. For view there is indeed not much you can do.

To make sure nobody directly modify some object which if supposed to be updated by a specific code the current strategy is usually to have a listener cancelling any modification to this document object unless the ExecutionContext (or some other way) contain a property indicating that the change come form an “authorized” code (which set this property before saving the document).

---

<div class="post-metadata">

**Author:** ![ben.megson](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/b/e274bd/32.png) [@ben.megson](https://forum.xwiki.org/u/ben.megson)\
**Post date:** [July 23, 2017, 1:13pm UTC](https://forum.xwiki.org/t/is-it-possible-to-protect-some-objects-in-a-page-but-not-others/339/4 "2017-07-23T13:13:20Z")

</div>

OK thanks, I’ve added this cancellation to an event listener
