I'm trying to create a validation rule to prevent 'portal' profile users to change ownership of lead record but they should be able to accept leads from 3 particular queues.
OR(
AND(ISCHANGED( OwnerId ),
$UserRole.Name = 'Portal',
PRIORVALUE(OwnerId) <>'00G1r000003Bhko'),
AND(ISCHANGED( OwnerId ),
$UserRole.Name = 'Portal',
PRIORVALUE(OwnerId) <>'00G1r000003Bhkm'),
AND(ISCHANGED( OwnerId ),
$UserRole.Name = 'Portal',
PRIORVALUE(OwnerId) <>'00G1q000001DzGV')
)