Possible to query whether a user has page rights?

Possible to query whether a user has page rights?

  

Maybe it's possible, maybe I'm missing something simple...

You know how you can CheckRole to find out if a user supports a particular role...

...and you know how you can check certain roles on and off for a page...

...is there a way to make something like CheckUserHasValidRoleForPage(PageName, UserId)?

It would be nice to make certain links disappear if the user does not have the rights to the target page without (A) duplicating the page roles manually in an If conditions and (B) letting the user go through and complaining they don't have the rights to that page after the fact.

Is there an entity in (System) that I could join to User_Role/Group_Role/Group_User or something? I can't see anything in there which might match...

-- Ritchie Annand

Hi, I think you can't get the relation between Page and Users. However you can get the relations below. All these entities are in System Components

It's the Page I really wish I could do something about.

Here's the example - I have a Settings page, and it restricted, though not just to Administrators. It has rights like this:

I want to be able to either hide or show a Settings link depending on whether the user would have access to this page.

We could add the usual If CheckAdminstratorRole() or CheckProgrammingRole() etc. but if we add or remove some of these check marks, the condition will be invalid. It would be nice to be able to say If CheckPageAccessible("Settings") and have that return True if the user has one of these checked roles.

It might not be possible, and my workaround is of course to do the manual check; I was just hoping :)

Cheers,

-- Ritchie Annand

nope,

there is an idea for that already to check the webscreen roles and the user.

you could argue if its really necessary ux-wise,

hiding links is not great.

dynamic menus you could fix differently.

and performancewise it might be an issue as well.


Ritchie Annand wrote:

I want to be able to either hide or show a Settings link depending on whether the user would have access to this page.

We could add the usual If CheckAdminstratorRole() or CheckProgrammingRole() etc. but if we add or remove some of these check marks, the condition will be invalid. It would be nice to be able to say If CheckPageAccessible("Settings") and have that return True if the user has one of these checked roles.

Hi Ritchie,

The check role function is the only way you can do what you need. 

Instead of using a condition in the screen, use instead of a link a screen action to always validate the role before navigating to the settings screen.

Regards,

Fair enough - I was just making sure I wasn't missing anything. Thank you :)