How to Fix permission issues such as being unable to install themes or plugins in macbook? 2 mints
when running WordPress on a localhost environment, especially on macOS, to resolve permission issues such as being unable to install themes or plugins. By changing the user to match the one owning the WordPress files (usually the system user), Apache can properly manage the files and folders without encountering permission errors.

changing the user ( here my username is adin so i changed it to adin)

If you used sudo chmod -R 777
on localhost, it means that all users (including the owner, group, and others) have full permissions (read, write, execute) on the specified directory and all its contents.