<Can> without subject
See original GitHub issueI have a flat component permission-wise, I do not really use the “of” -part (or subject) of the <Can> component.
Casl seems to work fine with me leaving it out but the React component gives prop type warnings.
I have worked around this by creating a custom can-component but I’m wondering if the prop-type validation could be loosened or if there is a more elegant way handling cases like:
<Can I="post" />
Tasks:
- update types for
ForbiddenError.throwUnlessCan
- update types for
can
,cannot
,relevantRuleFor
, rulesFor,
possibleRulesForof
Ability` - update types for
can
&cannot
ofAbilityBuilder
-
casl/angular
-
casl/aurelia
-
casl/vue
-
casl/react
- add tests for casl/ability
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (4 by maintainers)
Top Results From Across the Web
Is it correct to use 'can' in a sentence without a subject, like ...
So, no: It's not correct to use “can” in a sentence without a subject.
Read more >Verb "to be" without a subject not allowed?
A reviewer said this sentence is not correct, because the verb "to be" cannot be used without a subject. It should be: The...
Read more >Definition and Examples of Null Subjects in English - ThoughtCo
A null subject is the absence (or apparent absence) of a subject in a sentence. In most cases, such truncated sentences have an...
Read more >Null-subject language - Wikipedia
"[(S)he] does not want to pay." The subject "(s)he" of the second sentence is only implied in Italian. English and French, on the...
Read more >Verbs without subject | WordReference Forums
They are different tenses. The imperative tense ("verbs without subject") is used to express orders or commands and it is not the present...
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
will be available in casl 4.x
After some thinking about this, I realised that on
@casl/ability
level it can be implemented without changes. The only thing which you need to do is to define customsubjectName
function:The only thing which needs to be changed is Typescript declarations and complementary packages