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
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”.
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
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…
of this user on the demo site could be changed to what it needs to be with a POST or PATCH, described here in the docs.
This would ensure you do not corrupt the database tables and would not require you to refresh the cache.
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
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”.
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
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
···
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
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…
of this user on the demo site could be changed to what it needs to be with a POST or PATCH, described here in the docs.
This would ensure you do not corrupt the database tables and would not require you to refresh the cache.
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.
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
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”.
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