At a record level for the related action, is there a way to capture who is actua

At a record level for the related action, is there a way to capture who is actually logged in?

I tried the loggedinuser() doesn't seem to work. I want to see if the person that is logged in is the creator of the record, if they are then show them the related action.

OriginalPostID-187835

OriginalPostID-187835

  Discussion posts and replies are publicly visible

Parents
  • I'm assuming this rule is called in the visibility for the related action with rp!id as an input? I believe it can be simplified - see below, maybe even moreso than that - but it might also be worth wrapping the calls to get the products in an index function so that they only return single items rather than an array of a single item.

    In addition, have you tried debugging this rule by hardcoding the loggedInUser() and product to specific values to check it actually works?

    =load(
    local!productInfo : rule!RADARR_QR_PRODUCT_getProductByRADARRID(
    ri!radarrID
    ),
    local!projectInfo : rule!RADARR_QR_PROJECT_getProjectByProjectID(
    local!productInfo.PROJECT_ID
    ),
    if(
    and(
    local!productInfo.PRODUCT_STATUS = cons!RADARR_CST_productStatus[1],
    or(
    local!projectInfo.PROJECT_STATUS = cons!RADARR_CST_projectStatus[1],
    local!projectInfo.PROJECT_STATUS = cons!RADARR_CST_projectStatus[2]
    )
    ),
    true,
    and(
    local!productInfo.PRODUCT_STATUS = cons!RADARR_CST_productStatus[1],
    local!projectInfo.PROJECT_STATUS = cons!RADARR_CST_projectStatus[3],
    local!productInfo.PRODUCT_CREATOR = fn!loggedInUser()
    )
    )
    )
Reply
  • I'm assuming this rule is called in the visibility for the related action with rp!id as an input? I believe it can be simplified - see below, maybe even moreso than that - but it might also be worth wrapping the calls to get the products in an index function so that they only return single items rather than an array of a single item.

    In addition, have you tried debugging this rule by hardcoding the loggedInUser() and product to specific values to check it actually works?

    =load(
    local!productInfo : rule!RADARR_QR_PRODUCT_getProductByRADARRID(
    ri!radarrID
    ),
    local!projectInfo : rule!RADARR_QR_PROJECT_getProjectByProjectID(
    local!productInfo.PROJECT_ID
    ),
    if(
    and(
    local!productInfo.PRODUCT_STATUS = cons!RADARR_CST_productStatus[1],
    or(
    local!projectInfo.PROJECT_STATUS = cons!RADARR_CST_projectStatus[1],
    local!projectInfo.PROJECT_STATUS = cons!RADARR_CST_projectStatus[2]
    )
    ),
    true,
    and(
    local!productInfo.PRODUCT_STATUS = cons!RADARR_CST_productStatus[1],
    local!projectInfo.PROJECT_STATUS = cons!RADARR_CST_projectStatus[3],
    local!productInfo.PRODUCT_CREATOR = fn!loggedInUser()
    )
    )
    )
Children
No Data