code: public boolean shouldDisplayLayoutLink(
              IPerson person, PortletDefinitionForm form, String portletId) {
          if (!form.isNew()) {
              return false;
          }
  
          // only include the "do layout" link for published portlets.
          if (form.getLifecycleState() != PortletLifecycleState.PUBLISHED) {
              return false;
          }
  
          // check that the user can edit at least 1 fragment.
          Map<String, String> layouts =
                  fragmentAdminHelper.getAuthorizedDlmFragments(person.getUserName());
          if (layouts == null || layouts.isEmpty()) {
              return false;
          }
  
          // check that the user has subscribe priv.
          IAuthorizationPrincipal authPrincipal =
                  authorizationService.newPrincipal(
                          person.getUserName(), EntityEnum.PERSON.getClazz());
  
          return authPrincipal.canSubscribe(portletId);
      }
docs: Check if the link to the Fragment admin portlet should display in the status message.
  
  <p>Checks that the portlet is new, that the portlet has been published and that the user has
  necessary permissions to go to the fragment admin page.
  
  @param person the person publishing/editing the portlet
  @param form the portlet being editted
  @param portletId the id of the saved portlet
  @return true If all three conditions are met