User Control

tom_shen
edited February 11, 2022 in Analytics #1
<p>I have insall the trail version and run the birt report with oracle data source. </p>
<p>Now the system requirements are</p>
<p>1. Create user for different clients;</p>
<p>2. The user name related to the birt report they can view and execute;</p>
<p>3. Client can input different parameter value to run the report.</p>
<p> </p>
<p>Does Actute can realize it?</p>
<p>If yes, can you brief describe how to do it?</p>
<p> </p>
<p>I have tried in trail version to set user group and user. But I have no idea how to set the visit control?</p>

Comments

  • <p>I think the best solution is going to use user groups to place the users into specific groups related to what they are allowed to see and run.</p>
    <p> </p>
    <p>Each report/folder/item in the iHub can have it's permissions set through the sharing menu.</p>
    <p>To do so, select the down arrow next to a report/folder and choose Share. The new menu will let you assign specific users/groups to the report/folder and decided what they are allowed to do read, execute, delete, etc.</p>
    <p> </p>
    <p>Take a look at this documentation for more details: <a data-ipb='nomediaparse' href='http://developer.actuate.com/be/documentation/ihub31-dev/ic/index.html#page/using-ip/understanding-privileges.html#'&gt;http://developer.actuate.com/be/documentation/ihub31-dev/ic/index.html#page/using-ip/understanding-privileges.html#&lt;/a&gt;&lt;/p&gt;
    Warning No formatter is installed for the format ipb
  • <p>Thank for reply.</p>
    <p> </p>
    <p>I will try to realize it. </p>
    <p> </p>
    <p>Another question is if we want to use the username as the parameter to the report. Is it possible?</p>
  • <p>You can, but I wouldn't. You can get the username in the report with this expression:</p>
    <p> </p>
    <p>reportContext.getAppContext.get("ServerUserName")</p>
  • <p>Hi Team, For getting UserGroup name what is the command.</p>
  • <p>You will need to get the whole ACL (access control list), which will include the user and all his/her groups by using this:</p>
    <pre class="_prettyXprint">
    reportContext.getAppContext().get("USER_ACL")</pre>
  • <p>Hi Mblock,</p>
    <p> </p>
    <p>   Actually i need to filter my parameter based on user group. I can filter it by using '<span style="color:#008080;"><span style="font-family:'Source Sans Pro', sans-serif;">reportContext.getAppContext.get("ServerUserName")</span></span><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">'.</span></p>
    <p><span style="color:rgb(40,40,40);font-family:'Source Sans Pro', sans-serif;">My parameter will get value from dataset in which i have filtered the query with above command. But instead of username i want to filter with usergroup. I am not creating ACL in my report.</span></p>
    <p>  Also in which table i can get user and usergroup details in iHub. Please let me know the query to get these details in iHub server.</p>
  • <p>It is the user ACL (not the report ACL). So it will be the user and all the groups he belongs to. </p>
  • <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">Thanks Mblock,</span></span></p>
    <p><span style="font-family:arial, helvetica, sans-serif;font-size:12px;">In the above link they are filtering dataset with UserName from server. But i want to do the same with User Group name. For example,</span></p>
    <p> </p>
    <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">UserGroup     UserName </span></span></p>
    <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">USA               USA-1</span></span></p>
    <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">                       USA-2</span></span></p>
    <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">GERMANY   GER-1</span></span></p>
    <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">                      GER-2</span></span></p>
    <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;"><span style="color:rgb(0,128,128);">reportContext.getAppContext.get("ServerUserName") </span><span style="color:#000000;"><span>will pick the username. I need UserGroup data to filter my query,</span></span></span></span></p>
    <p> </p>
    <p><span style="color:#0000cd;"><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">select * from test_table where country = ? [UserGroup]</span></span></span></p>
    <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">So that the user's under specific country can get the values in Parameter page. Please let me know some alternate method if there is no similar method as in the mentioned link.</span></span></p>
  • <p>As I said before you need to use <span>reportContext</span><span style="color:rgb(102,102,0);">.</span><span>getAppContext</span><span style="color:rgb(102,102,0);">().</span><span style="color:rgb(0,0,136);">get</span><span style="color:rgb(102,102,0);">(</span><span style="color:rgb(0,136,0);">"USER_ACL"</span><span style="color:rgb(102,102,0);">)</span>. Instead of equality you need to use an "IN" clause as the user ACL is an array with all the users groups (remember a user can belong to more than one group). What version of Actuate are you using? I can try and create an example for you later this week or early next week. </p>
  • <p>Hi Mblock,</p>
    <p> </p>
    <p>  I am using iServer 11SP4 and BIRT designer professional Version: 11.0.4. We are in plan to upgrade to latest iHub and designer version.</p>
    <p> </p>
    <p>Thanks.</p>
  • <p>There is one there that uses the user ACL named ParameterACL.rptdesign. Please read the DevShare again. </p>
  • <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">Hi Mblock,</span></span></p>
    <p> </p>
    <p><span style="font-size:12px;"><span style="font-family:arial, helvetica, sans-serif;">   I got it. Thanks. In query i have used "IN" clause to get multiple user group.</span></span></p>
    <p> </p>
    <p><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">if (reportContext.getAppContext().get("USER_ACL") == null) {</span></span></span></p>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">"Australia";</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">}</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">else {</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">aclArray = reportContext.getAppContext().get("USER_ACL");</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">aclString = aclArray.join(",");</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">locACL = aclString.indexOf("Country_")</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">locComma = aclString.indexOf(",",locACL + 1);</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">if (locComma > 0) {</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">country = aclString.substring(locACL + 8,locComma);</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">}</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">else {</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">country = aclString.substring(locACL + 8);</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">}</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">country;</span></span></span></div>
    <div><span style="color:#0000cd;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">}</span></span></span></div>
    <div> </div>
    <div><span style="color:#000000;"><span style="font-size:10px;"><span style="font-family:arial, helvetica, sans-serif;">    This resulting only one value. If user 'D' is in "USA &Germany" then it resulting only Germany not USA. I tried by creating an Array to push all the values from USER_ACL into parameter but i am getting error.</span></span></span></div>
    <div><span style="font-size:10px;">Please help me out of this. If you provide me a sample that will be better.</span></div>
  • <p>Hi Mblock,</p>
    <p> </p>
    <p>  Got result :). Created a loop and concatenated the values. </p>
    <p> </p>
    <p> </p>
  • bmark
    edited April 12, 2017 #17
    <p>Hello,</p>
    <p> </p>
    <p>is this still working for iHub 16? I assigned the method '<span>reportContext</span><span>.</span><span>getAppContext</span><span>().</span><span>get</span><span>(</span><span>"USER_ACL"</span><span>)' to a report variable and put the variable to the report just to print out the result. But its empty.</span></p>
    <p> </p>
    <p><span>Did the key-name change?</span></p>
    <p> </p>
    <p><span>Thank you</span></p>
    <p> </p>
    <p><span>Benjamin</span></p>
    <p> </p>
    <p><span>[EDIT]: Its working. Sorry. My fault.</span></p>
  • <p>Glad to hear that it works. I did not think it had changed.</p>