Add limits to license and enforce Project limit #947
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #776 #780
This PR builds on #946 - that should get merged first.
This adds claims to the license to cover projects, users, teams and devices.
If no license is applied (CE edition), they default to the values described in #780
If a license is applied, it uses the values from the license, defaulting to
0
if not present.When the platform starts up, it reports on the counts:
In the second commit, changes are added to enforce the Project limit. This is done as a hook on the model itself - so any code path that tries to create a project in the database will be handled.
The UI side does a fairly default Alert notification that the license limit has been reached. That can be refined as I work through policing the other limits.
NOTE TO DEVELOPERS
Once this PR is merged, you will need to update the development license you are running with locally otherwise you will no longer be able to create projects (unless you run with no license at all). As before, this is provided in
forge/licensing/index.js
.