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

  • Hi Alastr

    Configure user start pages for users in admin console  ,for example request site for group A and group B, management site for group C

    so when ever user logged in , that user will get that particular site  which you have configured in user start pages.

    In site level you can configure pages visibility ,for suppose in your request site you have three pages(three tabs  tab1,tab2,tab3)  and this site is visible for group A and group B ,for group A only tab1 and tab2 for group B all tabs (based on your requirement ) 

  • thank you for answering but I want that these visibility by role is within an application that
    I'm doing with those users. for which I understand that it should be within my site> pages> visibility,
    is not it? what happens is that the code is not made
  • Sorry Alastr i didn't get you point 

    can you explain what is your exact requirement   

  • 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).

  • When I try to use that function within an expression rule, I do not
    it recognizes it. Is it in a plug-in package or can I find it for
    see how it is used?
  • 0
    Certified Lead Developer
    in reply to Alastr

    What function?  Are you talking about the example expression rule name I used in my last comment?