LPS-50077 SF: rename variable to 'first'
LPS-50077 Add tests for hasResourcePermission
LPS-50077 SF