LPS-40207 Modify logic in LayoutStagingImpl.isBranchingLayoutSet() to shortcut heavy operations.
LPS-40203 Remove needless checking for velocityTemplateId.
LPS-40203  Add local variable to avoid invoking methods in loop
LPS-40203 Remove needless condition checking in taglib/portlet/icon_options/page.jsp
LPS-40203 No need to use Validator in login.jsp
LPS-40203 Remove duplicate call in top_head.jsp.
LPS-40203 Source formatting
LPS-40203 Just use the implicit permissionChecker object. It's the same as themeDisplay.getPermissionChecker(). See  *.theme.DefineObjectsTag
LPS-40203 Those are not expensive operations?
LPS-40203 SF
LPS-40203 It is possible for someone to pass in a "" and it'd be incorrect. So previous check was right.
LPS-40203 This operation is cheap. Unless something is actually expensive, readability trumps performance.
LPS-40203 Better var name
LPS-32718 Use remote service to display only document types the user has permission to view
LPS-32718 GroupId is not necessary because it's not used by select_file_entry_type
LPS-32718 Use the right value to notify the service if the folder is inheriting the document type restrictions or not
LPS-32718 If we don't inherit we just return the document types allowed in that folder. If we inherit we return the document types allowed in the folder we are inheriting from (even it if it's empty). We don't want to always return at least one document type, because if the folder is restricted to only one document type and the user cannot add that document type, he won't be able to add any document in that folder.
LPS-32718 When editing a existing document, user will be able to select amongst the document types supported by that folder, considering that either he has VIEW permission on the doc types or it's the basic document, or it's the current document type of the document.
LPS-32718 We need DISTINCT (as in countByC_G_N_D_S) because otherwise we will get duplicates when applying permission to the query
LPS-32718 There is an issue that prevents "Basic Document" because of the permissions. As "Basic Document" is an entity that doesn't have any permission (because it's a 'fake' entity) we need to extract it from the query affected by the permission and do a UNION ALL to make sure that it's always returned.