It's all about the answers!

Ask a question

DNG REST API for users and permissions?


0
1
Michael Knop (111) | asked Oct 24 '19, 4:57 a.m.
edited Oct 24 '19, 5:26 a.m.

 Is it possible to use the DNG REST API to get a list of users, the roles they have, and the permissions per role?


EDIT: also teams and members of teams?

2 answers



permanent link
Aaron Duncan (11) | answered 22 hours ago
I would be very interested in seeing how to programmatically retrieve details from "https://server:port/jts/users/<user_id>" (since it returns the html page with ajax calls).

thanks.

Comments
Kirk Woods commented 9 hours ago

Set the request header "Accept: application/rdf+xml" 


Aaron Duncan commented 4 hours ago
 thanks.  that worked.

permanent link
Jean-François CHAPELLE (111) | answered Oct 24 '19, 5:20 a.m.

Michael,


with the REST API, you can extract some informations :

- list of projects
https://<server>:<port>/ccm/process/project-areas
- for each project, list of users
https://<server>:<port>/ccm/process/project-areas/<prjid>/members
- for each user, roles and status
roles : https://server:port/ccm/process/project-areas/<project_id>/members/<user_id>/role-assignments
status : https://server:port/jts/users/<user_id>

We have a small Perl script to do this extraction (we can share it, for example and help the Jazz users).

But, nothing about the permissions.

Regards



Comments
Michael Knop commented Oct 24 '19, 5:23 a.m.

you're example URLs show "ccm", will these work for "rm"? 


Jean-François CHAPELLE commented Oct 24 '19, 7:49 a.m.

Yes, the example works for "rm" ...



Jean-Michel Gay commented Nov 08 '19, 12:11 p.m. | edited Nov 08 '19, 12:12 p.m.

We have a small Perl script to do this extraction (we can share it, for example and help the Jazz users).

@jchapelle77 how do you pass authentication with Perl?


Jean-François CHAPELLE commented Nov 12 '19, 12:27 p.m.
my $userAgent = LWP::UserAgent->new( ssl_opts => { verify_hostname => 0 },
   protocols_allowed => ['https'],
   timeout => 1200);
my $http_request = HTTP::Request->new();
my $http_response = HTTP::Response->new();

$http_request->method('POST');

$http_request->uri($srvurl.'/j_security_check?j_username='.$authkey->{USER}.'&j_password='.$authkey->{PASSWORD});

$userAgent->cookie_jar({ file => "./jazz_cookies.txt"}); 

$http_response = $userAgent->request($http_request);

if ( $http_response->code eq "302" && $http_response->header('location') =~ m/\/auth\/authfailed/ || $http_response->code ne "302") = connect is failed 

Your answer


Register or to post your answer.