This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Report on PersonWantsOrg: user see all requests

Hi,

 

I'm trying to implement a report fot the productOwner that show only the requests an owner can see.

A product owner can be owner of more than a product so in object browser an user that is owner of 2 products will see only request for those products but in a report he can see all the requests.

I thought the permission on what an user can see will be applied to the report too.

Any advice?

 

(7.1)

Parents
  • There are two differences between the list of request in Object Browser and your report query.

    • First, the list in Object Browser is using the object layer and therefore the permissions of the logged on user while loading the list.
    • Second, you are using a native SQL query which can not use the permissions of the user that generates the request. And you are not limiting the result of your query to one specific person.

    In your report you need to do the two following things.

    1. Add a parameter to your query that limits the query to the person which is requesting the report. I'll call it @eportScheduledBy. The query looks like this than.
      select r.DisplayName, g.cn as Role, p.LastName + ' ' + p.FirstName as Person, s.ident_PwoState as Status, pwo.CCC_RequestCode as RequestCode, pwo.OrderDate as OrderDate 
      from PersonWantsOrg pwo
      join UNSGroupB g on pwo.ObjectKeyOrdered = g.xobjectkey
      join Person p on pwo.UID_PersonOrdered = p.UID_Person
      join PWOState s on s.UID_PWOState = pwo.UID_PWOState
      join UNSRootB r on r.UID_UNSRootB = g.UID_UNSRootB
      where pwo.UID_PersonOrdered = @ReportScheduledBy
      order by 1,2
    2. You add a parameter to your report called ReportScheduledBy and give the parameter a valuation script like the following.
      If Provider.Contains("UID_Person") Then 
      	Value = $UID_Person$
      Else
      	Value = Connection.User.Uid
      End If

    HINT:

    Take a look at the OOTB reports, for example VI_Reporting_Template_Portrait_Params. It contains the same parameter and you could see how the parameter has to be defined to set it automatically to the logged on / report subscription user.

Reply
  • There are two differences between the list of request in Object Browser and your report query.

    • First, the list in Object Browser is using the object layer and therefore the permissions of the logged on user while loading the list.
    • Second, you are using a native SQL query which can not use the permissions of the user that generates the request. And you are not limiting the result of your query to one specific person.

    In your report you need to do the two following things.

    1. Add a parameter to your query that limits the query to the person which is requesting the report. I'll call it @eportScheduledBy. The query looks like this than.
      select r.DisplayName, g.cn as Role, p.LastName + ' ' + p.FirstName as Person, s.ident_PwoState as Status, pwo.CCC_RequestCode as RequestCode, pwo.OrderDate as OrderDate 
      from PersonWantsOrg pwo
      join UNSGroupB g on pwo.ObjectKeyOrdered = g.xobjectkey
      join Person p on pwo.UID_PersonOrdered = p.UID_Person
      join PWOState s on s.UID_PWOState = pwo.UID_PWOState
      join UNSRootB r on r.UID_UNSRootB = g.UID_UNSRootB
      where pwo.UID_PersonOrdered = @ReportScheduledBy
      order by 1,2
    2. You add a parameter to your report called ReportScheduledBy and give the parameter a valuation script like the following.
      If Provider.Contains("UID_Person") Then 
      	Value = $UID_Person$
      Else
      	Value = Connection.User.Uid
      End If

    HINT:

    Take a look at the OOTB reports, for example VI_Reporting_Template_Portrait_Params. It contains the same parameter and you could see how the parameter has to be defined to set it automatically to the logged on / report subscription user.

Children
No Data