In my plugin, I am checking to see if the current logged in user has permission to save a commerce product.
$user = craft()->userSession->getUser();
if (craft()->userPermissions->doesUserHavePermission($user->id, 'ManageClothingProducts')) {
// yes permission
} else {
// no permission
};
However, it seems I'm always getting into the else
.
The commerce docs mention this:
Manage [type] products
Maybe I'm not using the correct syntax? I'm only using the clothing products as an example. Ultimately I'll be checking for my own products.
Thank you for any suggestions!