Made static view function in flask allowed.
Changed rule of checking permission, modified interface of check_permission, modified has_permission method.