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.

getAllNamedRoles returning null

See original GitHub issue

I have implemented these two methods:

    async getAllUserRoles(){
        let roles = this.enforcer.getAllNamedRoles('g');
        return roles;
    }

    async getAllResourceRoles(){
        let roles = this.enforcer.getAllNamedRoles('g2');
        return roles;
    }

And some of my policies are:

g, test_role, admin
g, sub_role_test1, test_role
g, sub_role_test2, test_role
g, sub_role_test2, test_role
g, test_role_2, admin
g, user_test, just_test_role
g2, glosas, plataforma
g2, credentials, plataforma

In both methods the result is null. Is this a bug?

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
hsluoyzcommented, Jan 5, 2019

@lucaslrolim getAllRoles() calls getAllNamedRoles() internally, so it proves this function works for at least for the example.

0reactions
lucaslrolimcommented, Jan 7, 2019

The error was really related to the order of my Express routes. Sorry about the mistake e thank you for the help @hsluoyz and @nodece.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Why does getLocalName() return null? - java - Stack Overflow
The Javadoc states that getLocalName() returns null for this type of node. Why node is of type DOCUMENT_POSITION_DISCONNECTED and not ELEMENT_ ...
Read more >
Enforcer class - casbin library - Dart API - Pub.dev
Returns false if the user or role does not have any permissions (aka not affected). deleteRole(String role) → void: deleteRole deletes a role....
Read more >
Client Class — Aerospike documentation - Read the Docs
Tests the connections between the client and the nodes of the cluster. If the result is False , the client will require another...
Read more >
aerospike Documentation - Read the Docs
aerospike is a package which provides a Python client for Aerospike database ... Returns a type representing the server-side type as_null.
Read more >
How to Avoid Returning Null from a Method - Coding Helmet
Simply put, the result is – null. What do we do with the null result then? Obviously, in languages like C++, Java or...
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