[xwiki-devs] Display "User Index" in drawer only to administrators
I tried to play around with drawer.vm but only in vain. I need to: 1] display 'User Index' from drawer only to administrator (not possible by 'administer page/parent' option) 2] add other applications e.g. 'Invitation', 'sandbox' to drawer -- View this message in context: http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin... Sent from the XWiki- Dev mailing list archive at Nabble.com.
Hello. For 1, you need to modify XWiki.UserIndexUIX to add a check on the administrator right (you could add $isAdmin and that's all). See: https://github.com/xwiki/xwiki-platform/blob/4f7e47962ad5867d85f16c2c0452fb2... For 2, you need to implement some UI extensions, see: http://platform.xwiki.org/xwiki/bin/view/ExtensionPoint/DrawerItem Documentation: http://extensions.xwiki.org/xwiki/bin/view/Extension/UIExtension+Module Thanks, 2016-05-19 5:33 GMT+02:00 superuser <[email protected]>:
I tried to play around with drawer.vm but only in vain. I need to: 1] display 'User Index' from drawer only to administrator (not possible by 'administer page/parent' option) 2] add other applications e.g. 'Invitation', 'sandbox' to drawer
-- View this message in context: http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin... Sent from the XWiki- Dev mailing list archive at Nabble.com. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Guillaume Delhumeau ([email protected]) Research & Development Engineer at XWiki SAS Committer on the XWiki.org project
I think we should add a short tutorial on how to customize the drawer on xwiki.org. Any taker? :) Thanks -Vincent
On 19 May 2016, at 10:55, Guillaume Delhumeau <[email protected]> wrote:
Hello.
For 1, you need to modify XWiki.UserIndexUIX to add a check on the administrator right (you could add $isAdmin and that's all). See: https://github.com/xwiki/xwiki-platform/blob/4f7e47962ad5867d85f16c2c0452fb2...
For 2, you need to implement some UI extensions, see: http://platform.xwiki.org/xwiki/bin/view/ExtensionPoint/DrawerItem
Documentation: http://extensions.xwiki.org/xwiki/bin/view/Extension/UIExtension+Module
Thanks,
2016-05-19 5:33 GMT+02:00 superuser <[email protected]>:
I tried to play around with drawer.vm but only in vain. I need to: 1] display 'User Index' from drawer only to administrator (not possible by 'administer page/parent' option) 2] add other applications e.g. 'Invitation', 'sandbox' to drawer
-- View this message in context: http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin...
For preventing the User Index to be proposed, it is probably simpler to just protect the Main.UserDirectory page from being seen by anyone else than admins, and the drawer option will be removed to those that does not have access. So, no need to tune this UIX, since it will just be inaccessible. On Thu, May 19, 2016 at 11:03 AM, Vincent Massol <[email protected]> wrote:
I think we should add a short tutorial on how to customize the drawer on xwiki.org.
Any taker? :)
Thanks -Vincent
On 19 May 2016, at 10:55, Guillaume Delhumeau < [email protected]> wrote:
Hello.
For 1, you need to modify XWiki.UserIndexUIX to add a check on the administrator right (you could add $isAdmin and that's all). See:
https://github.com/xwiki/xwiki-platform/blob/4f7e47962ad5867d85f16c2c0452fb2...
For 2, you need to implement some UI extensions, see: http://platform.xwiki.org/xwiki/bin/view/ExtensionPoint/DrawerItem
Documentation: http://extensions.xwiki.org/xwiki/bin/view/Extension/UIExtension+Module
Thanks,
2016-05-19 5:33 GMT+02:00 superuser <[email protected]>:
I tried to play around with drawer.vm but only in vain. I need to: 1] display 'User Index' from drawer only to administrator (not possible
by
'administer page/parent' option) 2] add other applications e.g. 'Invitation', 'sandbox' to drawer
-- View this message in context:
http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin...
_______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Denis Gervalle SOFTEC sa - CEO
But how can I protect that page? It has 'Administer Parent' option and not 'Administer Page' option? -- View this message in context: http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin... Sent from the XWiki- Dev mailing list archive at Nabble.com.
Ok done.. Added $xwiki.hasAdminRights() instead of $isAdmin Thank you -- View this message in context: http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin... Sent from the XWiki- Dev mailing list archive at Nabble.com.
On Thu, May 19, 2016 at 8:11 PM, superuser <[email protected]> wrote:
But how can I protect that page? It has 'Administer Parent' option and not 'Administer Page' option?
This is terminal document, you can manage access to that particular page by going to the Edit menu (the pen), and choosing Access Rights. To access the Edit menu (seeing it as a menu), you need to choose “Advanced User” as your user type, in the preference of your user profile. IMO, modifying the UIX is bad, not needed, and could lead more to issues on upgrades.
-- View this message in context: http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin... Sent from the XWiki- Dev mailing list archive at Nabble.com. _______________________________________________ devs mailing list [email protected] http://lists.xwiki.org/mailman/listinfo/devs
-- Denis Gervalle SOFTEC sa - CEO
On 20 May 2016, at 10:45, Denis Gervalle <[email protected]> wrote:
On Thu, May 19, 2016 at 8:11 PM, superuser <[email protected]> wrote:
But how can I protect that page? It has 'Administer Parent' option and not 'Administer Page' option?
This is terminal document, you can manage access to that particular page by going to the Edit menu (the pen), and choosing Access Rights. To access the Edit menu (seeing it as a menu), you need to choose “Advanced User” as your user type, in the preference of your user profile. IMO, modifying the UIX is bad, not needed, and could lead more to issues on upgrades.
To see how to use page access rights, see: http://platform.xwiki.org/xwiki/bin/view/AdminGuide/Access+Rights#HPageAcces... (newly updated version of 2 weeks ago) Thanks -Vincent
View this message in context: http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin... Denis Gervalle
thank you. i tried modifying UserIndexUIX by adding $isAdmin, but i dont know why it removes userindex from drawer for admin also. so please could you elaborate your answer with exact code? thanks -- View this message in context: http://xwiki.475771.n2.nabble.com/Display-User-Index-in-drawer-only-to-admin... Sent from the XWiki- Dev mailing list archive at Nabble.com.
participants (4)
-
Denis Gervalle -
Guillaume Delhumeau -
superuser -
Vincent Massol