SVYX-355 - allow properties to be solution specific#35
SVYX-355 - allow properties to be solution specific#35SteveHawes wants to merge 2 commits intoServoy:masterfrom
Conversation
…cific properties to be stored. All public methods have been updated to use the solution name as an optional final parameter so that it does not break any existing code.
…methods Modified the getUserProperty and getTenantProperty methods to look for old style properties (without solution name) if one cannot be found with a solution name.
|
Hi Steve, thank you for submitting your contribution. Using the propertyKey/propertyType fields you can include the solutionName into the property key.
In your use case, when getting the property you first have to look for the com.my-solution.my-property-name, if NULL look for the Global property. e.g. |
|
Hi Paolo, I did consider that as a possible solution but that makes it difficult to filter out the values that are for another solution, for example in a maintenance program. This means that you can see the property values for solutions that you may not have access to. By adding the field it is possible to use a DB, table or foundset filter to easily restrict the values available to the user. Also, each developer would need to implement their own scope for setting and getting the properties (and their values) and accidentally making a call to the core svyProperties scope could break the security of the solution. The way I have implemented it, it is universal for all developers and is difficult to get wrong. However, all that said, I do understand if this PR is rejected in favour of the developer implementing something in their own scope. Thanks |
|
Hi Steve, thanks for your response. Regards, |
This pull request implements the feature requested in SVYX-355.
The changes will now allow properties to be specified as follows:
The getUserProperty, getUserPropertyValue, getTenantProperty and getTenantPropertyValue methods have been updated so that if a property is requested via these methods and there is no matching record found that includes the solution name, the method will then look for a matching property without a specified solution_name. If this is found then a new property is created that matches the tenant_name and user_name but now with the solution_name added as well and this property is returned. This allows for user and tenant properties that were created prior to this change to be migrated silently in the background and also allows a mix of solutions that both include and exclude this change using the same DB.