How do field restrictions work in rule definition?
See original GitHub issueability = [
{
"actions": ["create", "read", "update", "delete"],
"subject": "Post",
"fields" : ['title'],
"conditions": {
"author": "${user.id}"
}
},
{
"actions": ["read", "update"],
"subject": "User",
"fields" : ['UserName','phoneNo'],
"conditions": {
"id": "${user.id}"
}
}
]
What would be expected behavior from the above Rules for an ability ? Does it restrict a user from updating the field ‘title’ in Task or does it allow only that field to be edited ?
I am trying to find a working example for ability.define(). Yes, there is one available for ability.can(). Can i have more information on this please ?
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Restrict data input by using validation rules - Microsoft Support
You can define validation rules for table fields and for controls on forms. When you define rules for tables, those rules apply when...
Read more >About Field-Level Rules - General Electric
Field-level rules define how a field will behave under certain circumstances. The field-level rules for a given field are stored within the family...
Read more >ConfiForms Field Definition Rules - Vertuna WIKI
Rules are the best way to add dynamics to your forms, make validation rules conditional or customise form UI behaviour. Available rules.
Read more >Definition & Execution of Business Rules for Fields ...
These rules need to be respected by the extracted field values, in order for the extraction to be considered successful (e.g. Invoice Number ......
Read more >Introduction to attribute rules—ArcGIS Pro | Documentation
Additionally, an attribute rule can be used to restrict values for an attribute field that are not part of the domain when performing...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
All properties in conditions are logically AND-ed and rules with the same pair of action and object are logically OR-ed
That’s why the 1st definitions doesn’t work
fields are just additional flags which you can use to enforce permissions. So, in your case:
Also you can use some useful helpers methods for
@casl/ability/extra
subpackage. You can find info about it here - https://github.com/stalniy/casl/tree/master/packages/casl-ability#4-extra