Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi,
I've had a request, for an application with sensitive data, to show on the dashboard of the application the names of the people who have been given access to use the application, which will update nightly (or perfect world, live) with any changes.
We grant users access by going to QlikView Management Console, Documents, User Documents, Selecting the Application and then in the Authorisation Ssection, adding Named Users.
Is this something thats possible?
Cheers,
Dean
Hi Dean,
Think there might be something in PowerTools that does this - maybe qv_user_manager, but I don't use it.
Another way might be to read the associated META file for the document as the users are written in clear text when you assign them to a document (if you know the domain name, you can use this as a delimiter to strip out the names) although how robust this is in practice I'm not sure ...
Let domain = '{domainname}\';
Meta:
LOAD concat (metadata,' ') as metadata;
LOAD Keepchar(upper(@1:n),'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\') as metadata
FROM {file} (fix, codepage is 1252);
MetaStripped:
Load '$(domain)' & subfield(metadata, '$(domain)', iterno()+1) as metacandidate
resident Meta while iterno()<SubStringCount(metadata,'$(domain)')+1;
flipside
Hi Dean,
Do you need to show the complete list of all the users or just the user who has logged on currently?
If you need to show only the user who has logged on currently then you can use OSUSER() function.
Hi Shyamal,
That's useful to know however it was a comprehensive list of people who could access the application.
Cheers,
Dean
Hi Dean,
Okay. So you are adding the names of users in QMC manually as and when required.
I can think of 2 options as of now:
1. Using section Access and setting the required users as ADMIN.
2. To maintain an excel file with the names, then you can always pull the names from the excel into your qvw file. (Not a standard approach, just an option)
Regards,
Shyamal
Hi Shyamal,
Thanks, looks like a manual excel solution (to be updated anytime access is given or taken way) is the best option for now.
Cheers,
Dean
Hi dean,
We have done just that. We have setup two levels of users in AD QVUSERS and QVADMIN and have a script which pulls all the staff details into a csv from AD. We then have a security qlikview app which pulls in the following data
we use the following to pull the data in csvde -f d:\qlikview\40_security\ad.csv
you also need the csvde file sitting on the same subfolder as the above script.
here is an example of the script you will need. Look at the intro to section access file
vtmpActiveUser = '=only(osuser())';
table:
let a=1;
do while a<150
LOAD
//distinguishedName,
trim(upper(sAMAccountName)) as USERID_SHEET_ACCESS,
//memberOf,
UPPER(subfield(subfield(subfield(memberOf,';',$(a)) , 'CN=', 2), ',', 1)) as QVGROUP_SHEET_ACCESS
FROM 40_Security\ad.csv (ansi, txt, delimiter is ',', embedded labels, msq)
where objectClass = 'user' AND UPPER(subfield(subfield(subfield(memberOf,';',$(a)) , 'CN=', 2), ',', 1)) LIKE 'QV*';;
//and left(subfield(subfield(memberOf,';',$(a)) , 'CN=', 2),1) = 'Q';
let a=a+1;
loop
t1:
Noconcatenate Load
'SHA-NET\' & USERID_SHEET_ACCESS AS User_auth,
'Yes' as Aut,
1 as _HCounter,
QVGROUP_SHEET_ACCESS as Group_Sheet_Access
resident table
where left(QVGROUP_SHEET_ACCESS,2) = 'QV';
DROP TABLE table;
STORE t1 into [10_ETLQVDFiles\t1.qvd] (qvd);
DROP Table t1;
LOAD User_auth,
Aut,
_HCounter,
Group_Sheet_Access
FROM
D:\QlikView\10_ETLQVDFiles\t1.qvd
(qvd);
Hello Dean
You can get this from the CalData.pgo file. I put together an entry in my blog that you can use to convert that into XML and the read it from Qlikview.
I hope this helps.
JV
You can also query the log file in \QLiktech\QlikviewServer\Sessios*.log
Look for the [authenticated user] field.
Hi,
You can use qvuser()
Hi Dean,
Think there might be something in PowerTools that does this - maybe qv_user_manager, but I don't use it.
Another way might be to read the associated META file for the document as the users are written in clear text when you assign them to a document (if you know the domain name, you can use this as a delimiter to strip out the names) although how robust this is in practice I'm not sure ...
Let domain = '{domainname}\';
Meta:
LOAD concat (metadata,' ') as metadata;
LOAD Keepchar(upper(@1:n),'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789\') as metadata
FROM {file} (fix, codepage is 1252);
MetaStripped:
Load '$(domain)' & subfield(metadata, '$(domain)', iterno()+1) as metacandidate
resident Meta while iterno()<SubStringCount(metadata,'$(domain)')+1;
flipside