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.

How can I use filter function in the controller to return the filtered data? To filter data with all user roles rules we need acess to permission object.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
shekohexcommented, Nov 19, 2018

if you need to access the permission object that located at the user object you could use @UserRoles('permission') decorator to access it, will return req.user.permission

if you asking about the Roles you have defined before, i.e the object passed to the AccessControlModule.forRoles(roles) then use @InjectRolesBuilder() instead.

0reactions
Morb0commented, Nov 19, 2018

@shekohex Ok, thank for help

Read more comments on GitHub >

github_iconTop Results From Across the Web

Array.prototype.filter() - JavaScript - MDN Web Docs
The filter() method creates a shallow copy of a portion of a given array, filtered down to just the elements from the given...
Read more >
FILTER function - Microsoft Support
Using FILTER with the multiplication operator (*) to return all values in our array. FILTER used to return multiple criteria and sort. In...
Read more >
JavaScript Array filter() Method - W3Schools
The filter() method creates a new array filled with elements that pass a test provided by a function. The filter() method does not...
Read more >
Filtering Array Elements Based on a Test Function
This tutorial shows you how to use the JavaScript array filter method to filter elements in an array based on a specified condition....
Read more >
How To Use the filter() Array Method in JavaScript | DigitalOcean
Use filter() on arrays to go through an array and return a new array with the elements that pass the filtering rules.
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