Need help troubleshooting a record's related action visibility

I'm trying to allow a certain subset of a user group to see a related action in a record. If the user belongs to GRP_7 AND has authorization for that organization, then the user should be able to see the related action. This code is from the visibility section of the record I'm interested in. I added everything between the comments, everything else is the original code. The part that I added worked on a different record in achieving the same thing, but doesn't seem to work in this case. The user can see related action 'A' and not 'B' but should see both 'A' & 'B'. The following is the SAIL code for the visibility of related action 'B'.

= and(
  or(
    rf!isActive,
    and(
      rf!isActive,
      rf!deactivationDate > now()
    )
  ),
  or(
    rf!Status = cons!PENDING_STATUS,
    rf!Status = cons!NEW_STATUS
  ),
  or(
    isusermemberofgroup(
      loggedInUser(),
      group(
        cons!GRP_1,
        "id"
      )
    ),
    isusermemberofgroup(
      loggedInUser(),
      group(
        cons!GRP_2,
        "id"
      )
    ),
    isusermemberofgroup(
      loggedInUser(),
      group(
        cons!GRP_3,
        "id"
      )
    ),
    isusermemberofgroup(
      loggedInUser(),
      group(
        cons!GRP_4,
        "id"
      )
    ),
    and(
      or(
        isusermemberofgroup(
          loggedInUser(),
          cons!GRP_6
        ),
        isusermemberofgroup(
          loggedInUser(),
          cons!GRP_7
        )
      ),
      rule!IsUserContact(
        userName_txt: loggedInUser(),
        organizationId_int: rf!organizationId
      )
    ),
    /* Is Corporate? AND Authorized? */
    and(
      
      isusermemberofgroup(
        loggedInUser(),
        cons!GRP_7
      ),
      
      contains(
        rule!GetAuthorizedOrgsNumberByUserName(
          loggedInUser()
        ),
        rf!organizationIdentifier
      )
      
    )
    /* END Is Corporate? AND Authorized? */
  )
)

  Discussion posts and replies are publicly visible

Parents Reply Children
No Data