What is the correct syntax to check if a user has permission?
The correct permission key is:

commerce-manageProductType:ID_OF_PRODUCT_TYPE_HERE

for example:

commerce-manageProductType:2

Your code would therefore be:



$user = craft()-&gt;userSession-&gt;getUser();
if (craft()-&gt;userPermissions-&gt;doesUserHavePermission($user-&gt;id, 'commerce-manageProductType:2')) {
    // yes permission
} else {
  // no permission
};


Or you could use UserSessionService::checkPermission(), which is a shortcut for checking permissions for the currently logged-in user:

if (craft()-&gt;userSession-&gt;checkPermission('commerce-manageProductType:2')