Issue #2061985 by InternetDevels: Replace user_access() calls with ->hasPermission() in entity module.