Skip to main content



      Home
Home » Eclipse Projects » Remote Application Platform (RAP) » Activate Menu Item depending on logged-in user
Activate Menu Item depending on logged-in user [message #106668] Mon, 29 September 2008 04:49 Go to next message
Eclipse UserFriend
Hi,

Following is the requirement:

A menu item in a context menu should be visible/enabled only when the
logged-in user belongs to a certain user-group (having elevated
privileges).

Currently, i am able to use the org.eclipse.ui.menus extension to display
the menu and enable/disable it based on the perspective using the
<activeWhen> tag (which was another requirement).

Any pointers on how the menu item can be enabled/disabled based on the
logged-in user? Basically, how can an object completely unrelated to the
UI be used to activate/deactivate a menu item? It would be preferable if
the bulk of this requirement could be implemented using plugin.xml, as
opposed to only programming in java.

TIA,
Best Regards,
-abhi
Re: Activate Menu Item depending on logged-in user [message #106682 is a reply to message #106668] Mon, 29 September 2008 04:54 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

the expression framework of Eclipse allows you to provide your own
property tester with the "org.eclipse.core.expressions.propertyTesters"
extension point.

Depending in your user/group authentication you should be able to query
your own propertyTester within a <visibleWhen> and <test> expression.

Greets
Benny

abhi wrote:
> Hi,
>
> Following is the requirement:
>
> A menu item in a context menu should be visible/enabled only when the
> logged-in user belongs to a certain user-group (having elevated
> privileges).
> Currently, i am able to use the org.eclipse.ui.menus extension to
> display the menu and enable/disable it based on the perspective using
> the <activeWhen> tag (which was another requirement).
> Any pointers on how the menu item can be enabled/disabled based on the
> logged-in user? Basically, how can an object completely unrelated to the
> UI be used to activate/deactivate a menu item? It would be preferable if
> the bulk of this requirement could be implemented using plugin.xml, as
> opposed to only programming in java.
>
> TIA,
> Best Regards,
> -abhi
>
>
Re: Activate Menu Item depending on logged-in user [message #106755 is a reply to message #106682] Mon, 29 September 2008 07:28 Go to previous message
Eclipse UserFriend
Hi,

Thanks a lot for the info.

I happened to stumble across org.eclipse.ui.activities extension, one of
whose purposes seems to be exactly making such UI contributions
visible/invisible through expression based activities. The Eclipse help
section
( http://help.eclipse.org/ganymede/topic/org.eclipse.platform. doc.isv/guide/workbench_advext_activities.htm)
provides documentation for the same.

Thanks again for the input!

Best Regards,
-abhi
Previous Topic:how to support login + password authentication?
Next Topic:bug: preference can't be exported in rap
Goto Forum:
  


Current Time: Fri Apr 25 23:40:51 EDT 2025

Powered by FUDForum. Page generated in 0.03644 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top