...
Code Block | ||
---|---|---|
| ||
{ "id": "api.user.ownership.transfer.list", "ver": "1.0", "ts": "2023-08-28T13:54:45Z+05:30", "params": { "resmsgid": "a638c46e-63a5-47de-bf00-029cbe435e5e", "msgid": null, "err": null, "status": "successful", "errmsg": null }, "responseCode": "OK", "result": { "count": 1, "user": [ { "organisationId": <organisationId>, "userId": "<userId>", "username": "<username>", "status": 0, "roles": ["Content Creator"], "toUserId": "<transferred_userId>", "toUsername": "<toUsername>" "createdDate": "<createdDate>", "createdBy": "<created_userId>", "updatedDate": "<updatedDate>", "updatedBy": "<updatedBy_userId>" } ] } } |
Transfer ownership API: This API will trigger the kafka event to transfer-ownership flink job, to precess the things asynchronously. This API will validate if “toUserId“ has all the roles of from user.
...
Flink Job
Transfer ownership:
...
Update the status to PROCESSING in sunbird.user_ownership_transfer
table.
Asset
...
Sample kafka event
Code Block |
---|
{
"eid": "BE_JOB_REQUEST",
"ets": 1619527882745,
"mid": "LP.1619527882745.32dc378a-430f-49f6-83b5-bd73b767ad36",
"actor": {
"id": "ownership-transfer",
"type": "System"
},
"context": {
"channel": "01309282781705830427",
"pdata": {
"id": "org.sunbird.platform",
"ver": "1.0"
},
"env": "dev"
},
"object": {
"id": "do_11329603741667328018",
"type": "OwnershipTransfer"
},
"edata": {
"organisationId": "{{organisationId}}"
"fromUserId": "{{FROM_UUID}}",
"toUserId": "{{TO_UUID}}",
"asset": [],
"action": "ownership-transfer",
"iteration": 1
}
} |
Update the status to PROCESSING in
sunbird.user_ownership_transfer
table.Asset
Fetch the list of created content/course/batch by fromUserId, using the composite search API.
Update the createdBy and creator using content system update API.
Batch
Fetch the list of open and ongoing batches created by fromUserId from
sunbird_courses.course_batch
table.Update the user entry in
sunbird_courses.course_batch
table for open and ongoing batches only.createdby
If the user is added as a course mentors to any batch, than user use the search API to find out the batches and than remove the userId from mentors column in
sunbird_courses.course_batch
table.
Groups - Transfer the ownership to any other group admin if any other group admin is available else 1st assign the admin to any member and then transfer the ownership.
Update the status to COMPLETED.
...
status
0 - SUBMITTED
1 - PROCESSING
2 - COMPLETED
TBD
Cron Job:
Run on specific interval to do the sanity check of deletion.
API for other services to insert/update the data in
sunbird.user_deletion_status
table. Kafka event structure.
Check list:
Check with Cokreat regarding user PII information stored as part of program - No PII data is stored as part of program program.
Check in all the services, where user PII data is logged.
Check discussion forum for PII data
...