xwikisas / application-licensing

Manage and enforce application licenses for pro extensions
GNU Lesser General Public License v2.1
1 stars 8 forks source link

Create a missing license rendering macro #157

Closed oanalavinia closed 8 months ago

oanalavinia commented 11 months ago

For displaying the There is no valid license for.. message on each licensed application, right now we have 2 macros getMissingLicenseMessage and getMissingLicenseMessageHTML from the Licenses.Code.VelocityMacros page. E.g. of usages on diagram and pdfViewer image The problem with this is that we need to explicitly give view right for the VelocityMacros page, to avoid issues like https://github.com/xwikisas/application-licensing/issues/155

The proposal is to have a rendering macro that will be registered without this view right (like it happens with translations) and use it {{missingLicenseMessage extensionName="diagram.extension.name" /}}

We should also investigate a solution for the usage in pdfViewer, maybe to specify that the template uses wiki syntax by adding ##!source.syntax=xwiki/2.1, such as in here.

oanalavinia commented 10 months ago

This will also be of help for those that use custom groups instead of the standard XWikiAdminGroup and XWikiAllGroup. These users do not benefit from the fixes of #155 #156 (they need to specify manually the name of their custom groups)

lucaa commented 7 months ago

As far as I understand the fix for this issue, it's basically bringing back issues #155 and #160 for all the cases when the user upgrades one of their Pro applications to a version that depends on Licensor 1.25 without updating the other Pro apps to a version that was updated to use Licensor 1.25 (the new style of validating licence introduced by this ticket).

@oanalavinia can you confirm that this is correct and this situation can arrive?

oanalavinia commented 7 months ago

@lucaa Yes, this can happen if indeed there are apps that were not upgraded, while the Licensor was.

The old fix, with the rights object on the VelocityMacros page, was changed because there are cases were the XWikiAllGroup or XWikiAdminGroup are not used

Since not all pro apps have this issue reproducing, and also not for all of them is a problem (e.g. the error is displayed on the app homepage that is not used, or shouldn't be accessed by non-admin users), I am adding below the list of apps and the fix version, by category.

Error displayed while using the macro / app:

  1. Calendar - 2.13.3
  2. Diagram - 1.20.1
  3. Flash - 1.7.2
  4. PDFViewer - 2.5.4
  5. Pro Macros - 1.14.5
  6. Task Manager - 3.3.3
  7. XWiki Pro - 13.12.1

Error displayed only on the application homepage:

  1. Confluence Migrator - > 1.11.2
  2. Meeting - 1.14.3
  3. ActiveDirectory - 1.16.10
  4. Google Apps - 2.6.1
  5. Azure - 1.7.5
  6. Office365 - 1.11.3

Error displayed on the app administration page:

  1. Antivirus - 1.6.1
  2. Forum - 2.9.2