← Back to team overview

dhis2-users team mailing list archive

Fwd: [Dhis2-devs] Adding an Org Unit for Data Capture to User from back end

 

Great.

If you do not have a need to specify the level at which the user should be
able to view data, you should simply leave it blank.

Regards,
Jason

---------- Forwarded message ----------
From: Laura E. Lincks <laura.lincks@xxxxxxxxxxxxxxxxx>
Date: Tue, Aug 25, 2015 at 7:42 PM
Subject: Re: [Dhis2-devs] Adding an Org Unit for Data Capture to User from
back end
To: Jason Pickering <jason.p.pickering@xxxxxxxxx>


Right... the
​"​
userdatavieworgunits
​"​
is what I needed... The issue is our admin account was set to have access
to capture data from the country level (and lower
​, ie., everything​
) but at the analysis level it only had access to a few counties
(sub-national level) and that was the problem.
​ And there was no other account I could log into to restore the proper
access from the front end.​


I've been viewing the data as you suggested in the web browser and could
confirm what was assigned to the admin account.
​T​
he country level Org Unit was missing from the <dataViewOrganisationUnits>
tag, preventing the account from running certain pivot tables which
addressed all counties and not just the subset it had Analytics access to.
​ (The
 </organisationUnits> tag was always correct.)
By inserting a record into "userdatavieworgunits" and clearing the server
cache (thanks to your suggestion) I could see that the admin account now
has Analytics access to the entire country.

However, I was not aware we could leave that empty to imply Access to
everything... good to know... I thought we had to be specific.

I am much more comfortable with database manipulation than command line
requests, hence my desire to manipulate the data back end. But thank you
for pointing me to the docs to describe how to
​modify settings from the command line.​


Anyway, it looks like our issue is resolved... The admin account has access
to everything it needs to have access to.

Thank you!

*Laura E. Lincks*
Database Manager/Developer
ICAP - Columbia University
Mailman School of Public Health
60 Haven Ave, Floor B1
New York, NY 10032
Tel: 212 304 7132

On Tue, Aug 25, 2015 at 1:28 PM, Jason Pickering <
jason.p.pickering@xxxxxxxxx> wrote:

> Hi Laura,
>
> OK, but in your mail you indicated you were trying to change "Org Unit
> for Data Capture and Analysis" which corresponds to "usermembersip", which
> I think is the latter, which controls where the user can enter data. The
> "userdatavieworgunits" corresponds to the level where users can actually
> view data. If it is not set, the user can view everything.
>
> The better way to do this would be to GET "http://yourserver/api/users/UID";
> where UID is the uid of the user you need to change. For instance...
>
> <organisationUnits>
> <organisationUnit id="ImspTQPwCqd" name="Sierra Leone" code="OU_525"
> created="2012-11-13T11:20:53.028+0000" lastUpdated="
> 2015-04-24T09:21:00.090+0000"href="
> https://apps.dhis2.org/demo/api/organisationUnits/ImspTQPwCqd"/>
> </organisationUnits>
>
> of this user  on the demo site
> <https://apps.dhis2.org/demo/api/users/ec7FaM7xdqR> could be changed to
> what it needs to be with a POST or PATCH, described here in the docs
> <https://www.dhis2.org/doc/snapshot/en/developer/html/ch01s09.html#d5e742>
> .
>
> This would ensure you do not corrupt the database tables and would not
> require you to refresh the cache.
>
> Regards,
> Jason
>
>
> On Tue, Aug 25, 2015 at 7:17 PM, Laura E. Lincks <
> laura.lincks@xxxxxxxxxxxxxxxxx> wrote:
>
>> Thanks, Jason.
>>
>> Yes, the front end is best, but sometimes mistakes happen and we can't do
>> it through the front end.
>>
>> It
>> ​appears
>> that *userdatavieworgunits *is the table which stores the *Org Units
>> assigned under Data output and analysis organisation units* and
>> *usermembership *stores *Org Units under Data capture and maintenance
>> organisation units. *
>>
>> My immediate interest is with the former.
>>
>> ​I'll try clearing the cache.​
>>
>>
>> *Laura E. Lincks*
>> Database Manager/Developer
>> ICAP - Columbia University
>> Mailman School of Public Health
>> 60 Haven Ave, Floor B1
>> New York, NY 10032
>> Tel: 212 304 7132
>>
>> On Tue, Aug 25, 2015 at 1:11 PM, Jason Pickering <
>> jason.p.pickering@xxxxxxxxx> wrote:
>>
>>> Hi Laura,
>>> Be sure to clear the server cache if you perform and direct manipulation
>>> of the database tables (Administration->Cache statistics and then "Clear
>>> cache") . The recommended way of doing this would be to use the API instead
>>> of manipulating these tables directly.
>>> However, the "userdatavieworgunits" is not the table which controls
>>> which orgunit a user is assigned to, but rather "usermembership".
>>>
>>> Regards,
>>> Jason
>>>
>>> On Tue, Aug 25, 2015, 17:31 Laura E. Lincks <
>>> laura.lincks@xxxxxxxxxxxxxxxxx> wrote:
>>>
>>>> I'm trying to re-assign an Org Unit for Data Capture and Analysis to a
>>>> user from the Postgres backend.
>>>>
>>>> I see data stored in the userdatavieworgunits table. I can insert a row
>>>> into the table and see my results when selecting from the table but the
>>>> changes don't affect what I see in the front end or the web api for the
>>>> user. The information there does not change.
>>>>
>>>> Any tips on what I might be missing? Thanks.
>>>>
>>>> *Laura E. Lincks*
>>>> Database Manager/Developer
>>>> ICAP - Columbia University
>>>> Mailman School of Public Health
>>>> 60 Haven Ave, Floor B1
>>>> New York, NY 10032
>>>> Tel: 212 304 7132
>>>> _______________________________________________
>>>> Mailing list: https://launchpad.net/~dhis2-devs
>>>> Post to     : dhis2-devs@xxxxxxxxxxxxxxxxxxx
>>>> Unsubscribe : https://launchpad.net/~dhis2-devs
>>>> More help   : https://help.launchpad.net/ListHelp
>>>>
>>>
>>
>
>
> --
> Jason P. Pickering
> email: jason.p.pickering@xxxxxxxxx
> tel:+46764147049
>




-- 
Jason P. Pickering
email: jason.p.pickering@xxxxxxxxx
tel:+46764147049

References