RecepBilgin I just tested on my local Flarum install and it works. When I set allow_post_editing to 0 my user with no role can no longer edit their posts as soon as they publish them. I also tried setting 1 and it works as expected, the post can be edited during one minute only.
Are you maybe testing inside a tag that has restrictions put on it ? (a tag with custom permissions on the permissions page), there are some known issue with that. Also make sure you're testing with a user that doesn't have the "Edit post" moderation permission as those users can always edit posts.