bloodhound-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mat...@apache.org
Subject svn commit: r1453236 - /incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/product_admin.py
Date Wed, 06 Mar 2013 09:36:02 GMT
Author: matevz
Date: Wed Mar  6 09:36:02 2013
New Revision: 1453236

URL: http://svn.apache.org/r1453236
Log:
#430 - Multiproduct UI: Administration pages (hide Products in product scope)

Modified:
    incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/product_admin.py

Modified: incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/product_admin.py
URL: http://svn.apache.org/viewvc/incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/product_admin.py?rev=1453236&r1=1453235&r2=1453236&view=diff
==============================================================================
--- incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/product_admin.py
(original)
+++ incubator/bloodhound/branches/bep_0003_multiproduct/bloodhound_multiproduct/multiproduct/product_admin.py
Wed Mar  6 09:36:02 2013
@@ -28,6 +28,7 @@ from model import Product
 from trac.util.translation import _, N_, gettext
 from trac.web.chrome import Chrome, add_notice, add_warning
 from multiproduct.util import ProductDelegate
+from multiproduct.env import ProductEnvironment
 
 
 class ProductAdminPanel(TicketAdminPanel):
@@ -37,6 +38,11 @@ class ProductAdminPanel(TicketAdminPanel
     
     def get_admin_commands(self): 
         return None
+
+    def get_admin_panels(self, req):
+        if isinstance(req.perm.env, ProductEnvironment):
+            return None
+        return super(ProductAdminPanel, self).get_admin_panels(req)
     
     def _render_admin_panel(self, req, cat, page, product):
         req.perm.require('PRODUCT_VIEW')



Mime
View raw message