Table of Contents |
---|
...
Property | Sub-property | Values | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
name | {category name} | name of the category. | |||||||||
pid | {parent category id} | under which parent category, this category should get created. | |||||||||
Context |
or
|
or
|
| ||||||||
enbaleGroups | true / false | If set true then, It will be used to create groups to add privileges to a certain set of user (according to our requirement) | |||||||||
groups (optional) |
|
|
| ||||||||
privileges |
| ||||||||||
copytoChildren | true/false |
| |||||||||
copyFromCategory | {category_id} |
| |||||||||
copytoChildren | true / false | If set, it will take the rules from the given category. | |||||||||
copyFromCategory | category_id, from where it should take the privileges. groups are optional when category_id mention here. It will copy the group & privileges from category_id | ||||||||||
subcategories | categories which is gonna be created under the parent category | ||||||||||
name | Example: “Announcement“, “General discussion“ | name of the subcategory | |||||||||
pid | parent category id under which the sub-category will be created | ||||||||||
description | description of the sub-category | ||||||||||
context |
|
| this is to communicate with the mapping table. | ||||||||
privileges | This is to override the privileges given at category level for group or user | ||||||||||
copyFromCategory | category_id, from where it should take the privileges. | ||||||||||
groups |
|
| It will be used to define certain set of privileges so that it can be used for the categories. this is optional. | ||||||||
users |
|
| the set of users, the privilges gonaa be set for. |
Geeralization of api
This api is for creating a context with mappig category and enablig groups ad adding users into groups.
Code Block |
---|
curl --location --request POST 'https://dev.sunbirded.org/discussion/forum/v3/create' \ --header 'Connection: keep-alive' \ --header 'Access-Control-Allow-Origin: *' \ --header 'Accept: application/json' \ --header 'X-App-Id: dev.sunbird.portal' \ --header 'User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36' \ --header 'X-Device-Id: 6d20ec529bbe2081fbbd2ab80398e81c' \ --header 'X-Channel-Id: b00bc992ef25f1a9a8d63291e20efc8d' \ --header 'Content-Type: application/json' \ --header 'Origin: https://dev.sunbirded.org' \ --header 'Sec-Fetch-Site: same-origin' \ --header 'Sec-Fetch-Mode: cors' \ --header 'Sec-Fetch-Dest: empty' \ --header 'Referer: https://dev.sunbirded.org/my-groups/group-details/5bb0f6d6-58b8-4e90-8fa9-77c38901d8b4' \ --header 'Accept-Language: en-US,en;q=0.9' \ --header 'Cookie: _csrf=5E5KVAVALy__G4RVgzUGt7Za; connect.sid=s%3AztbChUZUWd1Ch8XpFtKm-8WMpqI8ojIq.kI9DLqKrBoTRyj%2FVknHYEgl8BEbaRnuqvyRIwtUL63U' \ --data-raw '{ "category": { "name": "Test Generalization API - 2", "pid": "34", "uid": "1", "description": "", "context": [ { "type": "course", "identifier": "KP_FT_1602790320113" } ], "enbaleGroups": "true", "groups": [ { "name": "Owner Group", "privileges": [ "groups:topics:reply", "groups:topics:create" ], "sbUids" : ["8454cb21-3ce9-4e30-85b5-fade097880d8", "fca2925f-1eee-4654-9177-fece3fd6afc9"] }, { "name": "enrolled users group", "privileges": [ "groups:topics:reply" ], "sbUids" : ["8454cb21-3ce9-4e30-85b5-fade097880d8", "fca2925f-1eee-4654-9177-fece3fd6afc9"] } ] } }' |
Generalization api for Update(If there is any mistakes)
...