Changeset 3074
- Timestamp:
- Jan 22, 2007, 11:16:43 AM (16 years ago)
- Location:
- trunk/src/core
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/core/common-queries.xml
r3050 r3074 1786 1786 JOIN plg.guiContexts gcx 1787 1787 LEFT JOIN plg.configurations cfg 1788 WITH cfg.owner.id = :owner OR cfg.itemKey.id IN (:itemKeys) OR cfg.projectKey.id IN (:projectKeys) 1788 WITH true = :hasConfigPermission OR cfg.owner.id = :owner 1789 OR cfg.itemKey.id IN (:itemKeys) OR cfg.projectKey.id IN (:projectKeys) 1789 1790 WHERE 1790 (plg.owner.id = :owner OR plg.itemKey.id IN (:itemKeys) OR plg.projectKey.id IN (:projectKeys)) 1791 (true = :hasPluginPermission OR plg.owner.id = :owner 1792 OR plg.itemKey.id IN (:itemKeys) OR plg.projectKey.id IN (:projectKeys)) 1791 1793 AND gcx.itemType = :itemType AND gcx.contextType = :contextType 1792 1794 AND ( -
trunk/src/core/net/sf/basedb/core/PluginDefinition.java
r3052 r3074 266 266 throws BaseException 267 267 { 268 SessionControl sc = dc.getSessionControl(); 269 boolean hasConfigPermission = sc.hasPermission(Permission.USE, Item.PLUGINCONFIGURATION); 270 boolean hasPluginPermission = sc.hasPermission(Permission.USE, Item.PLUGINDEFINITION); 271 268 272 org.hibernate.Session session = dc.getHibernateSession(); 269 273 org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session, "COUNT_PLUGINS_BY_TYPE_FOR_CONTEXT"); … … 273 277 JOIN plg.guiContexts gcx 274 278 LEFT JOIN plg.configurations cfg 275 WITH cfg.owner.id = :owner OR cfg.itemKey.id IN (:itemKeys) OR cfg.projectKey.id IN (:projectKeys) 279 WITH true = :hasConfigPermission OR cfg.owner.id = :owner 280 OR cfg.itemKey.id IN (:itemKeys) OR cfg.projectKey.id IN (:projectKeys) 276 281 WHERE 277 (plg.owner.id = :owner OR plg.itemKey.id IN (:itemKeys) OR plg.projectKey.id IN (:projectKeys)) 282 (true = :hasPluginPermission OR plg.owner.id = :owner 283 OR plg.itemKey.id IN (:itemKeys) OR plg.projectKey.id IN (:projectKeys)) 278 284 AND gcx.itemType = :itemType AND gcx.contextType = :contextType 279 285 AND ( … … 284 290 GROUP BY plg.mainType 285 291 */ 292 293 // Context 286 294 query.setInteger("itemType", gc.getItem().getValue()); 287 295 query.setInteger("contextType", gc.getType().getValue()); 288 296 289 SessionControl sc = dc.getSessionControl(); 297 // Role permissions 298 query.setBoolean("hasConfigPermission", hasConfigPermission); 299 query.setBoolean("hasPluginPermission", hasPluginPermission); 300 290 301 // Owner 291 302 query.setInteger("owner", sc.getLoggedInUserId());
Note: See TracChangeset
for help on using the changeset viewer.