Changeset 4533


Ignore:
Timestamp:
Sep 18, 2008, 8:44:05 AM (13 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1112: Create new items with project default properties from active project

Changed permission checked so that the active project and logged in user is always readable by plug-ins.

Location:
trunk/src/core/net/sf/basedb/core
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/net/sf/basedb/core/Project.java

    r4527 r4533  
    220220    super.initPermissions(granted, denied);
    221221  }
     222  /**
     223    Make sure plug-ins always has at least read access to the active project.
     224    @since 2.9
     225  */
     226  PluginPermission getPluginPermissions()
     227  {
     228    PluginPermission pp = super.getPluginPermissions();
     229    if (getId() == getSessionControl().getActiveProjectId())
     230    {
     231      pp.granted |= Permission.grant(Permission.READ);
     232    }
     233    return pp;
     234  }
    222235  // -------------------------------------------
    223236
  • trunk/src/core/net/sf/basedb/core/User.java

    r4517 r4533  
    393393    }
    394394    super.initPermissions(granted, denied);
     395  }
     396  /**
     397    Make sure plug-ins always has at least read access to the logged in user.
     398    @since 2.9
     399  */
     400  PluginPermission getPluginPermissions()
     401  {
     402    PluginPermission pp = super.getPluginPermissions();
     403    if (getId() == getSessionControl().getLoggedInUserId())
     404    {
     405      pp.granted |= Permission.grant(Permission.READ);
     406    }
     407    return pp;
    395408  }
    396409  // -------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.