Better permission checking