Category Permissions Function Bug

This should fix the category permissions bug.