M-Files / VAF.Extensions.Community

Community-built .NET extension methods for use with the M-Files Vault Application Framework.
MIT License
25 stars 20 forks source link

Incorrect display of user group restrictions in Admin Dashboard #129

Closed FredTheDane closed 6 months ago

FredTheDane commented 6 months ago

In the dashboard content renderer, a "GetTernaryStatementDashboardContent" helper is used to select either a valid or exceeded user group message.

https://github.com/M-Files/VAF.Extensions.Community/blob/c418376e39b0abd5122b3c36ec06a8e68f1378f2/MFiles.VAF.Extensions/Dashboards/ApplicationOverviewDashboardContent/DefaultApplicationOverviewDashboardContentRenderer.cs#L291-L295

However, in the above snippet, the ternary expression is "If the user group member length is longer than the license restriction length", which is the case when the license has been exceeded, the incorrect message is shown in admin.

https://github.com/M-Files/VAF.Extensions.Community/blob/c418376e39b0abd5122b3c36ec06a8e68f1378f2/MFiles.VAF.Extensions/Resources/Licensing.resx#L147

In the above snippet as well, it seems that the template only uses argument 0 and 1, and not 2. Which results in M-Files admin showing "User group ABCD has 50 members, which is more than the licensed value of 50." when the restriction is set to 50 even though there might be less users in the group.

CraigHawker commented 6 months ago

Thank you for this Fred. I am likely to create an updated version of the VAF Extensions later this week so this will be included in that.