As required by the project, the Login Dialog Box is displayed before eclipse RCP starts. After logon, the function module is assigned according to the permissions of the user. You can
Platformui. createandrunworkbench (display, new ideworkbenchadvisor ());
I have done this before, but it is a problem to load various views. Therefore, the solution is as follows.
To enable rcp to start and load the plug-in based on the module in the database, you must determine the plug-in and remove the plug-ins that do not belong to the current user from the plug-in registry. Extensionregistry provides the removeextension method, but you need to pass a token, which is created at system startup and is private in this class, so you have to first get the token: Object token through reflection;
Extensionregistry exregulatory = (extensionregistry) Platform
. Getextensionregistry ();
Try {
Field field = exregulatory. getclass (). getdeclaredfield ("mastertoken ");
Field. setaccessible (true );
Token = field. Get (exregulatory );
} Catch (exception e ){
Return;
}
Then you can
(Extensionregistry) exregulatory). removeextension (exts, token );
The specified plug-in has been deleted.