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.

Client-side permission checking problem

See original GitHub issue

I’m trying to check permissions on the client, but the Permissions don’t seem to be coming across. Here’s what I have in my dialog.ts file: if (!Authorization.hasPermission("Review:Review:Modify")) {

That eventually calls t.get_userDefinition().Permissions[n] where n = “Review:Review:Modify” Q.getRemoteData(“UserData”) returns an object with a Permissions property which is not null, but it doesn’t appear to hold any data either.

The user is a member of a role which has that permission. Any ideas what I’m missing?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:12 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
volkanceylancommented, May 2, 2016

Alright, found the bug:

            result.Permissions = TwoLevelCache.GetLocalStoreOnly("UserPermissions:" + user.Id, TimeSpan.Zero,
                UserPermissionRow.Fields.GenerationKey, () =>

I used same key for UserPermissionService and UserData, so one was returning other.

Replace “UserPermissions:” with “ScriptUserPermissions:” in UserEndpoint.cs. Funny nobody noticed this before, including me

0reactions
JohnRangercommented, Jun 11, 2016

Had exactly the same error. This fixed it!

Read more comments on GitHub >

github_iconTop Results From Across the Web

check permission at client side? #254
I am wondering any facility exists in the framework to check user permission at client side. I have anangular application and want to ......
Read more >
Is it okay to handle user permissions client side only in a ...
Option 1) It is better to handle user permissions at the server side using node js . Like create node API to post...
Read more >
Trying to check permissions for my commands on the client
recently i have been trying to insert an attempt to check if the user has permission to execute a command, but i have...
Read more >
How to troubleshoot the "You are not authorized to start ...
Cause. The user is not properly authorized to access and display some UI component of the client-side human service that implements the ...
Read more >
Best way to do Client side authorization for a single page ...
Check permissions on every view? Just seems like a lot of API requests. c. Create a separate app for a Dashboard? That way...
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