Issue with version 4.1.1
See original GitHub issueAfter update to version 4.1.1 I get the error bellow:
TypeError: i[r].validationFunction.indexOf is not a function
at http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:15:16333
at Object.r [as forEach] (http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:5:24003)
at e.t (http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:15:16173)
at http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:15:13949
at Object.a [as invoke] (http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:6:11955)
at i.validatePermission (http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:1:15940)
at http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:1:20541
at Array.map (native)
at s.resolvePropertyValidity (http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:1:20368)
at i (http://app.sistemamais.com.br/main.d8eb1933d403ee234700.bundle.js:1:19143)
Its happen when uglify with webpack. If return to version 4.0.6 works perfectly. Thanks.
Issue Analytics
- State:
- Created 7 years ago
- Comments:10
Top Results From Across the Web
Fatal error with with version 4.1.0 and 4.1.1 - WordPress.org
I've managed to roll back to an older version that was still working (4.0.6, fwiw), so this isn't as urgent, but you should...
Read more >Samsung One UI 4.0, 4.1 & 4.1.1 (Android 12) update bug ...
A detailed & continuously updated round-up of everything related to Samsung One UI 4.0, 4.1 & 4.1.1 bugs, issues, and problems.
Read more >Android Studio 4.1.1 available
Issue #152941155: Feature Request: Project Property with Android Studio version. Issue #160269604: Run command often does not start activity.
Read more >Android 4.1.1 Still Vulnerable to Heartbleed - PCMag
While Google has applied patches to many of its top products in response to the Heartbleed bug, Android 4.1.1 is still vulnerable, ...
Read more >Revoscan Mac Version 4.1.1? - Issues & Faults - Revopoint 3D
This wikiHow teaches you how to install software that isn't approved by Apple on your Mac. MacOS Sierra marks most unofficial apps as...
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
@masterspambot I don’t really need to check the existence of
validationFunction
. What I need is a way of saying if a user who has a given role has a specific permission.Let me explain: I have an application client-server.
The server handles a list of users. These users are assigned a list of roles. Let say a user
User01
isROLE_ADMIN
andROLE_EDITOR
:In the client, my angularjs application, I defined a
roleStore
and apermissionStore
. Let says for instanceThose permissions are only used for the front-end (client) to access certain pages, or menus…
Now if I create a section in the front-end which is restricted to
permission-only="canEditSection"
, it is natural to define the validation of the store by using a method to check if the user has this permission. Since the backend does not know anything about the permissions of the front-end, I need to know if among the permission store defined, a certain role (one of the user’s) has the permission ‘canEditSection’.So as you see, the validation is not just checking the existence of the roleDefinition, or the existence of the permission definition, but it is to know if the permission is associated to a given/named role. Before v4.x
validationFunction
seemed to provide us with that mapping, but since v4.x this info seems to be missing. It like we can only check if the permission definition exists or the role definition exists, and that’s it. Or did I misunderstand something?Repying to myself:
OK, I think I understand why this is happening. Before, in v3.2.1 the constructor:
function Role(roleName, validationFunction) {...}
could return anArray
if thevalidationFunction
parameter was defined as an array:this.validationFunction = validationFunction;
But now in v4.1.1, we have
this.validationFunction = annotateValidationFunction(validationFunction);
which now returns aFunction
no matter what type of the parameter of the constructor. Moreover, that function seems to be a promise.So, in my service, if I use instead:
roles[roleName].validationFunction().then(...)
, I get a too many recursion error. Now I’m stuck! 😕Some help to make us see clear would be much appreciated 😃