question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Check for "all" entities instead of "at least one"

See original GitHub issue

Hi,

I currently have this ability :

can("read", "User", { id: this.id });

Basically, every user in the app have the permission to read their own profile. But admins can read every profiles so, they have this ability

can("read", "User");

And everything is ok for individual profiles check.

But il also have a list of all users. And only admin can see this list.

The check can("read", "User"); returns true for both, because, as specified in the documentation, every user can read at least one user : themselves.

How can I check for “can read ALL users” ?

Thanks you in advance for response

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Varkalcommented, Feb 4, 2020

Ok, i’ve got it!

Thank you very much for your help !

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to count entities with commands/check if there are only ...
Then, count all the entities you want by getting each entity to increase a score by 1. First command is repeating, others are...
Read more >
Best way to check if object exists in Entity Framework? [closed]
If you don't want to execute SQL directly, the best way is to use Any(). This is because Any() will return as soon...
Read more >
check from one entity's screen if another entity's attribute list ...
One other way to put it: I want to check if all the B values are equal to 2, and at least one...
Read more >
[MC-121934] execute sub-commands only run (for each entity ...
This means, only if the @s[tag=test] returns at least one entity, for each entity of the first sub-command, the command will do something....
Read more >
Querying data via the DbSet - Learn Entity Framework Core
The First , and FirstOrDefault methods are intended to be used to return one result from potentially many matches. If you expect at...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found