# Setting rights for user profile pages

**URL:** <https://forum.xwiki.org/t/setting-rights-for-user-profile-pages/2222>\
**Category:** Help / Discuss\
**Tags:** rights, profile, users, xwiki\
**Created:** [January 10, 2018, 12:57pm UTC](https://forum.xwiki.org/t/setting-rights-for-user-profile-pages/2222 "2018-01-10T12:57:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![prase09](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@prase09](https://forum.xwiki.org/u/prase09)\
**Post date:** [January 10, 2018, 12:57pm UTC](https://forum.xwiki.org/t/setting-rights-for-user-profile-pages/2222/1 "2018-01-10T12:57:20Z")

</div>

I need to set “View” rights to all the users in XWikiAllGroup and “Edit” rights to all users in “XWikiAdminGroup” for **User Profile page**

I need to achieve something like below,

![image](https://discourse.xwiki.org/uploads/default/original/1X/a631f6cf5f886b7309d673df62000e05c36ef022.png)

---

<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:** [January 10, 2018, 2:53pm UTC](https://forum.xwiki.org/t/setting-rights-for-user-profile-pages/2222/2 "2018-01-10T14:53:08Z")

</div>

This is already what you have by default. Standard user profile creation tool add a right setup for edit for the user itself which mean only the user and anyone who have admin right can edit this page.

---

<div class="post-metadata">

**Author:** ![prase09](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@prase09](https://forum.xwiki.org/u/prase09)\
**Post date:** [January 10, 2018, 3:35pm UTC](https://forum.xwiki.org/t/setting-rights-for-user-profile-pages/2222/3 "2018-01-10T15:35:45Z")

</div>

But it happen in reverse for me, all the users in XWikiAllGroups and XWikiAdminGroups can able to edit their or other user profile.

I don’t know what went wrong exactly.

---

<div class="post-metadata">

**Author:** ![prase09](https://forum.xwiki.org/letter_avatar_proxy/v4/letter/p/a587f6/32.png) [@prase09](https://forum.xwiki.org/u/prase09)\
**Post date:** [January 11, 2018, 12:35pm UTC](https://forum.xwiki.org/t/setting-rights-for-user-profile-pages/2222/4 "2018-01-11T12:35:19Z")

</div>

You are 100% right. It has same right as you mentioned by default. Since i have migrated hunderds of users into group.

And the prefix “XWiki” does not contain in username added in to group that caused this issue.

ex. user name **prasanthr** should be in **XWiki.prasanthr**

Since it has hundreds of user, i have created an velocity macro to append those prefix in all. I have done the changes but after running the changes are not reflected. Here is my macro,

> {{velocity}}  
> #set ($mydoc = $xwiki.getDocument(“XWiki.XWikiAllGroup”))  
> #foreach($obj in $mydoc.getObjects(“XWiki.XWikiGroups”))  
> #set($dummy = $obj.getXWikiObject().member.value)  
> #if(!$dummy.contains(“XWiki.”))  
> #set($newvalue = “XWiki.” + $dummy)  
> $obj.set(“member”, $newvalue)  
> $obj.getXWikiObject().member.value  
> #end  
> $mydoc.save()  
> #end  
> {{/velocity}}

Do i miss anything here ☹

---

<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:** [January 16, 2018, 5:12pm UTC](https://forum.xwiki.org/t/setting-rights-for-user-profile-pages/2222/5 "2018-01-16T17:12:55Z")

</div>

I don’t see anything obvious just by looking at the code. $obj.getXWikiObject().member.value print the expected result ? Make sure you use the object editor instead of relying on the group UI to be safe.
