Changeset 6343


Ignore:
Timestamp:
Nov 12, 2013, 12:47:41 PM (10 years ago)
Author:
olle
Message:

Refs #1779. Plug-in configurations are now not shown if the logged-in user lacks USE permission:

  1. Class/file ContextUtil.java in src/core/net/sf/basedb/util/ is updated in public static method List<ContextResult> checkContext(DbControl dc, ItemQuery<PluginDefinition> pluginQuery, ItemQuery<PluginConfiguration> configQuery, GuiContext context, Object currentItem) to check if a plug-in and optional configuration have USE permission for the logged-in user.


File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/3.2-stable/src/core/net/sf/basedb/util/ContextUtil.java

    r5595 r6343  
    3030import net.sf.basedb.core.DbControl;
    3131import net.sf.basedb.core.ItemQuery;
     32import net.sf.basedb.core.Permission;
    3233import net.sf.basedb.core.PluginConfiguration;
    3334import net.sf.basedb.core.PluginDefinition;
     
    6970    for (PluginDefinition plugin : plugins)
    7071    {
     72      // Skip plug-in if user doesn't have USE Permission for it
     73      if (!plugin.hasPermission(Permission.USE))
     74      {
     75        continue;
     76      }
    7177      if (!plugin.requiresConfiguration())
    7278      {
     
    7985        for (PluginConfiguration config : configs)
    8086        {
     87          // Skip config if user doesn't have USE Permission for it
     88          if (!config.hasPermission(Permission.USE))
     89          {
     90            continue;
     91          }
    8192          results.add(new ContextResult(sc, plugin, config, context, currentItem));
    8293        }
Note: See TracChangeset for help on using the changeset viewer.