Visibility roles of a site page

Hello,

I have a question with the visibility roles of a site page. I have three sites (request, management, new) and in each. For example

"
=isusermemberofgroup(tostring(loggedInUser()), a!groupsByName("managers"))"

but I can not see or see a page if I get a different role

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    I can't tell what you're asking.  What are you expecting or hoping to happen?  What are you experiencing instead?

  • Title                       Icon                                                 Content Visibility
    Consultation     C_PM_consultationSol                  =isusermemberofgroup(tostring(loggedInUser()), a!groupsByName("managers"))
    Management    C_PM_managementSol                =isusermemberofgroup(tostring(loggedInUser()), a!groupsByName("analyst"))
    Registration      C_PM_registrationSol                   =isusermemberofgroup(tostring(loggedInUser()), a!groupsByName("managers"))

    I need these roles for these sites and I do not know how to do it:
    manager: registration and consultation
    analyst: management and consultation

  • Hi Alejandro - you need to think in terms of "sets". You will have one "set" (or Group) that represents Managers, another for Analysts; and then you need 3 other "sets" (Groups) that represent the roles of: Consultation, Management and Registration.

    Your Consultation Group needs to contain: the Manager and Analyst groups

    Your Management Group needs to contain: the Analysts group

    Your Registration Group needs to contain: the Manager Group

    Your visibility rules will then refer to the relevant group from the second set.

    Note: it's better to use constants to hold references to groups than use the a!groupsByName() because a Group's name is not immutable - someone might edit that Group and change its name. But a constant of type 'Group' will act as a permanent pointer to the Group even if the Group's name is changed. Where you need a list of the Groups, re-use the ones you've created as single constants and write an Expression Rule to return the list of those Groups

    Your code should look something like this:

    Title Icon Content Visibility
    Consultation C_PM_consultationSol =isusermemberofgroup(tostring(loggedInUser()), rule!XXX_ER_GROUPS_CONSULTATION)
    Management C_PM_managementSol =isusermemberofgroup(tostring(loggedInUser()), cons!XXX_GROUP_ANALYST)
    Registration C_PM_registrationSol =isusermemberofgroup(tostring(loggedInUser()), cons!XXX_GROUP_MANAGER)

    Hope this helps


    S>

  • 0
    Certified Lead Developer
    in reply to Alastr

    In addition to Stewart's answer which I agree with all of it, I would also recommend that you set up a separate expression rule to handle the visibility for each different site page.  So something like "PREFIX_SitePageVisibility_Consultation()", which accepts 1 parameter of username, and contains the necessary group-checking code within it.  This will allow you to test the result of the visibility expression easily across a variety of users (just put in different usernames in the test input), and makes future adjustments easier (since you don't need to edit the site setup to make small changes).

Reply
  • 0
    Certified Lead Developer
    in reply to Alastr

    In addition to Stewart's answer which I agree with all of it, I would also recommend that you set up a separate expression rule to handle the visibility for each different site page.  So something like "PREFIX_SitePageVisibility_Consultation()", which accepts 1 parameter of username, and contains the necessary group-checking code within it.  This will allow you to test the result of the visibility expression easily across a variety of users (just put in different usernames in the test input), and makes future adjustments easier (since you don't need to edit the site setup to make small changes).

Children