Closed nicolaes closed 3 years ago
This is very cool! I'll add a link to the Readme!
For me at least, it is not very clear what a permission DSL is. Searching did not help. Maybe it would be helpful to explain what that means and how it is related to a parser for mathematical expressions.
Hi @theRealProHacker,
Sorry I'm just now seeing your comment. My code uses the parser to combine permissions. By permission DSL I understand an AND-OR language that you apply for permissions. Basically a boolean logic parser. E.g. in Angular:
<div *appDisplayIf="isPremiumUser AND (subscribed OR hasTrial)">
Premium content.
</div>
This boolean logic DSL evolved quite nice since I started using it and is still the most condensed algorithm I found. It's used by non-technical people in my project to configure UI permissions and display conditions.
Ah, okay now I see. So you replace +
and -
with AND
and OR
?
But what does the abbreviation "DSL" even stand for? Is it "domain specific language"?
@theRealProHacker yes, +
and -
are replaced with AND
/ OR
.
It's a domain specific language because you can write rudimentary boolean logic with it.
If you think it's useful, I can make it into a PR. https://stackblitz.com/edit/typescript-vhd3tn?file=index.ts