def has_change_permission(self, page, lang, method=None):
        """Return ``True`` if the current user has permission to
        change the page."""

        # the user has always the right to look at a page content
        # if he doesn't try to modify it.
        if method != 'POST':
            return True

        # right to change all the pages
        if self.change_page():
            return True
        if lang:
            # try the global language permission first
            perm = self.user.has_perm(
                'pages.can_manage_%s' % lang.replace('-', '_')
            )
            if perm:
                return True
            # then per object permission
            perm_func = getattr(self, 'manage (%s)_page' % lang)
            if perm_func(page):
                return True
        # last hierarchic permissions because it's more expensive
        perm_func = getattr(self, 'manage hierarchy_page')
        if perm_func(page):
            return True
        else:
            for ancestor in page.get_ancestors():
                if perm_func(ancestor):
                    return True

        # everything else failed, no permissions
        return False
def has_change_permission ( self , page , lang , method = None ) : if method != 'POST' : return True if self . change_page ( ) : return True if lang : perm = self . user . has_perm ( 'pages.can_manage_%s' % lang . replace ( '-' , '_' ) ) if perm : return True perm_func = getattr ( self , 'manage (%s)_page' % lang ) if perm_func ( page ) : return True perm_func = getattr ( self , 'manage hierarchy_page' ) if perm_func ( page ) : return True else : for ancestor in page . get_ancestors ( ) : if perm_func ( ancestor ) : return True return False
Return ``True`` if the current user has permission to
        change the page.