@ Override @ RequestCache public boolean mayAddPortlet ( final IPerson user , final IPortletDefinition portletDefinition ) { Validate . notNull ( user , "Cannot determine if null users can browse portlets." ) ; Validate . notNull ( portletDefinition , "Cannot determine whether a user can browse a null portlet definition." ) ; // short-cut for guest user, it will always be false for guest, otherwise evaluate return user . isGuest ( ) ? false : authorizationService . canPrincipalSubscribe ( AuthorizationPrincipalHelper . principalFromUser ( user ) , portletDefinition . getPortletDefinitionId ( ) . getStringId ( ) ) ; }
Answers whether the given user may add the portlet to their layout