User gets access denied to css files and js files even though user is logged in [closed]

In most typical WordPress configurations the load of CSS/JS assets is not actually processed by WordPress core. Otherwise the performance would be horrible.

Web servers do fantastic work at serving static files like that though, so WP’s configuration (.htaccess or other, depending on server) just passes all such files to them.

It’s not clear from your description:

  • if that user can access files when not logged in
  • if specific files cannot be accessed or definitely all files

WP admin uses PHP for concatenation of assets, which does tend to cause issues now then. You can try setting SCRIPT_DEBUG constant to true in configuration to disable it (as well as minified versions) and see if that makes a difference.

But for completely static assets this is unlikely to be caused by WordPress core in general. Check server logs for clues, especially if you are running security and/or firewall modules on it.