/*
  * (non-Javadoc)
  *
  * @see
  * org.sentilo.web.catalog.controller.CrudController#doAfterViewResource(org.springframework.ui
  * .Model)
  */
 protected void doAfterViewResource(final Model model) {
   // If application belongs to a third organization then its token must be hidden to user.
   final Application resource = (Application) model.asMap().get(getEntityModelKey());
   if (!TenantUtils.isCurrentTenantResource(resource)) {
     resource.setToken("**************");
   }
 }
예제 #2
0
 @Before("((update(tenantResource) || create(tenantResource)) && @annotation(auditable) )")
 public void doSimpleAdvice(
     final JoinPoint jp, final TenantResource tenantResource, final Auditable auditable) {
   if (TenantContextHolder.isEnabled()) {
     final String currentTenant = TenantUtils.getCurrentTenant();
     switch (auditable.actionType()) {
       case CREATE:
         addTenantFields(tenantResource, currentTenant);
         break;
       case UPDATE:
         keepTenantFields(tenantResource);
         break;
       default:
         break;
     }
   }
   return;
 }