LPS-43627

Hey Hugo,

I read Jorge's comments and tried to rework it so that it didn't break anything else. The issue stems from https://issues.liferay.com/browse/LPS-27608 where it checks to see if the current user is editing himself. I came up with two solutions, but still am unsure about them (I wanted to cut down on the time difference by submitting two at once). If neither of them seem like the right fix to you, I'll just go ahead and post on the forums. This fix simply catches the PrincipalException thrown by the permission checker and swallows it. I did this because if the user does not have permission to update the layout then the UI to change the layout does not show up for them either.

The second fix (I'll post a link to it in the comments) I took the permission checks from LayoutSetServiceImpl.updateLayoutSetPrototypeLinkEnabled and checked those permissions before even going into changing the layout.

Let me know if you have any questions. Thanks.