[TECH SUPPORT] LPS-34190 Creating permissions for new layouts is slow

Hey Ray,

This is a bug fix from support, and I'm sending it to you because it's somewhere between staging and resource permissions.

The basic problem is that when you add resource permissions the code first checks for the existing permissions and then adds it. This check is slow in some cases. In case of import sometimes we do know that a Layout for example is new then it's not necessary to check just easier to add them.

This bugfix tries to address this problem.

The changes I've applied to the code aims to make the API clearer, I think the original was confusing.

Can you please review this?

Thanks,

Máté