def allow(self, role, method, resource, with_children=True):
if with_children:<EOL><INDENT>for r in role.get_children():<EOL><INDENT>permission = (r.get_name(), method, resource)<EOL>if permission not in self._allowed:<EOL><INDENT>self._allowed.append(permission)<EOL><DEDENT><DEDENT><DEDENT>if role == '<STR_LIT>':<EOL><INDENT>permission = (role, method, resource)<EOL><DEDENT>else:<EOL><INDENT>permission = (role.get_name(), method, resource)<EOL><DEDENT>if permission not in self._allowed:<EOL><INDENT>self._allowed.append(permission)<EOL><DEDENT>
Add allowing rules.

        :param role: Role of this rule.
        :param method: Method to allow in rule, include GET, POST, PUT etc.
        :param resource: Resource also view function.
        :param with_children: Allow role's children in rule as well
                              if with_children is `True`