Dataset Access Report

Keeping track of who has access to what dataset can be tiresome.

To answer questions like "What datasets does User X have access to ?" and "Who has access to dataset Y?" it is necessary to run three separate search commands across each tab.

 

However, by using the Gizmo 'endpoint' and the script provided below it is possible to generate a csv file containing all this information. Here's how.

1  Login to OrgVue

2  Go to the Gizmo endpoint using this URL (you'll have to copy this link, then adapt it for your specific OrgVue environment and Tenant ID details) : - 

https://[ORGVUE ENVIRONMENT URL]/[TENANT ID]/gizmo

To determine your tenant's Tenant ID use this URL adapted as necessary : -

https://[ORGVUE ENVIRONMENT URL]/tenants/tenants

3  Enter this script : -

var dsets = resource.datasets().filter(m => m.type != 'TREES').map((m)=>{
    var t = [];
    m.tags.forEach((x, i) => {
        var ret = x.split(':').length > 1 ? x.split(':')[1].split(',').map(y => y.trim()) : []
        if(ret.length > 0){
            ret.map((z) => {
                t.push({t: z, r: x.split(':')[0]});
            });
        }
    })
    return {name: m.name, tags: t, owner: m.owner, type: m.type};
})
var l = [];
var users = resource.dataset("Users").nodes().map((u) => {
    var r = u.Role.split(',').map(x => x.trim());
    var sets = dsets.map((d) => {
        if(d.tags.filter(t => r.indexOf(t.t) != -1).length > 0 || u.login == d.owner || r.indexOf('admin') != -1){
            var a = u.login == d.owner ? "owner" : r.indexOf('admin') != -1 ? "admin" : d.tags.filter(t => r.indexOf(t.t) != -1)[0].r
            l.push({user: u.login, dataset: d.name, type: d.type, right: a});
        }
    })
})
response.asCsv(l)



4 Click 'post'.
5 This will result in a csv file being downloaded to your machine.
6 Open this file from Excel and you are then able to filter for particular users or datasets.

 

Thanks to Mo Bahida in our Hague office for creating this article.

 

 

Have more questions? Submit a request

Comments