Hi there,
We have set up a demo XWiki site (version 15.4) and had good success customizing the vertical user profile to hide some options for non-admin users (e.g., in the userPreferences UIX - hiding view hidden pages, set user type as simple or advanced). We did this by applying the #if (hasAdmin) condition in front of the desired #displayFields:
$escapetool.xml($services.localization.render(‘platform.core.profile.section.displayPreferences’))
#if ($hasAdmin)
#displayField(‘displayHiddenDocuments’, ‘platform.core.profile.displayHiddenDocuments’, ‘0’)
We also have the Parameters set to:
id=preferences
icon=wrench
#isActive: The user is seeing her own profile or the user is an admin.
isActive=#if ($xcontext.userReference == $doc.documentReference || $hasAdmin)true#{else}false#end
priority=20
Recently, we upgraded to 15.8 and got a “failed to execute [velocity] macro” error message on the userPreferences menu. If I remove the #if(hasAdmin) lines in the velocity script entirely, the Display Preferences box reappears but now I’m not sure how to go about achieving that same customization. I’m also curious to know why this macro ‘broke’ in the upgrade and how we could prevent that happening on future upgrades.
Thanks!