def add_permissions_view(self, base_permissions, view_menu):
view_menu_db = self.add_view_menu(view_menu)<EOL>perm_views = self.find_permissions_view_menu(view_menu_db)<EOL>if not perm_views:<EOL><INDENT>for permission in base_permissions:<EOL><INDENT>pv = self.add_permission_view_menu(permission, view_menu)<EOL>role_admin = self.find_role(self.auth_role_admin)<EOL>self.add_permission_role(role_admin, pv)<EOL><DEDENT><DEDENT>else:<EOL><INDENT>role_admin = self.find_role(self.auth_role_admin)<EOL>for permission in base_permissions:<EOL><INDENT>if not self.exist_permission_on_views(perm_views, permission):<EOL><INDENT>pv = self.add_permission_view_menu(permission, view_menu)<EOL>self.add_permission_role(role_admin, pv)<EOL><DEDENT><DEDENT>for perm_view in perm_views:<EOL><INDENT>if perm_view.permission.name not in base_permissions:<EOL><INDENT>roles = self.get_all_roles()<EOL>perm = self.find_permission(perm_view.permission.name)<EOL>for role in roles:<EOL><INDENT>self.del_permission_role(role, perm)<EOL><DEDENT>self.del_permission_view_menu(perm_view.permission.name, view_menu)<EOL><DEDENT>elif perm_view not in role_admin.permissions:<EOL><INDENT>self.add_permission_role(role_admin, perm_view)<EOL><DEDENT><DEDENT><DEDENT>
Adds a permission on a view menu to the backend

:param base_permissions:
    list of permissions from view (all exposed methods):
     'can_add','can_edit' etc...
:param view_menu:
    name of the view or menu to add