]> git.llucax.com Git - z.facultad/75.52/sercom.git/blobdiff - sercom/menu.py
Mejorar listado de casos de prueba.
[z.facultad/75.52/sercom.git] / sercom / menu.py
index da714d168c7a10c2ac8ee6e73b01c421f5f94346..1d90c8929ee649adede1e9b01fc55a69854f6895 100644 (file)
@@ -13,17 +13,19 @@ class Menu:
         self.items = ['dashboard'] + self.items
 
     def _check(self, c):
+        if hasattr(c, 'hide_to_admin') and 'admin' in identity.current.permissions: return False
+        if hasattr(c, 'hide_to_entregar') and 'admin' not in identity.current.permissions: return False
         return c.require.eval_with_object(identity.current)
 
     def __repr__(self):
         option = u"""<option value="%s">%s</option>" """
         template = """
         <div id="navbar">
-                       Ir a :
-                       <select OnChange="window.location=this.options[this.selectedIndex].value;">
-                               %s
-                       </select>
-               </div>
+                Ir a :
+                <select OnChange="window.location=this.options[this.selectedIndex].value;">
+                    %s
+                </select>
+            </div>
         """
         s = option % ('', '-----')
         for i in self.items: