
class SecProxy(object)

  session = None

  def __init__(self, session):
    self.session = session
    
  

@@ -18,16 +18,18 @@
 bject)%0A%0A
+  
   sessio
@@ -38,16 +38,18 @@
 = None%0A%0A
+  
   def __
@@ -75,16 +75,20 @@
 n):%0A    
+ 
+   
 self.ses
@@ -110,8 +110,1131 @@
     %0A  %0A
+    def is_menu_public(item):%0A        %22%22%22%0A            Check if menu item has public permissions%0A    %0A            param item:%0A                menu item%0A        %22%22%22%0A        role = self.session.query(Role).filter_by(name = AUTH_ROLE_PUBLIC).first()%0A        lst = role.permissions%0A        if lst:%0A            for i in lst:%0A                if item == i.view_menu.name:%0A                    return  True%0A            return False%0A        else: return False%0A%0A    def is_item_public(permission_name, generalview_name):%0A        %22%22%22%0A            Check if view has public permissions%0A    %0A            param permission_name:%0A                the permission: can_show, can_edit...%0A            param generalview_name:%0A                the name of the class view (child of BaseView)%0A        %22%22%22%0A%0A        role = self.session.query(Role).filter_by(name = AUTH_ROLE_PUBLIC).first()%0A        lst = role.permissions%0A        if lst:%0A            for i in lst:%0A                if (generalview_name == i.view_menu.name) and (permission_name == i.permission.name):%0A                    return True%0A            return False%0A        else: return False%0A    %0A

Update access.py