gw_fct_admin_role_upsertuser - Giswater/giswater_dbmodel GitHub Wiki


Description

Function to create and modify database user, its role and it assignes to cat_manager

Input example

SELECT gw_fct_admin_role_upsertuser($${
"client":{"device":4, "infoType":1, "lang":"ES"},
"form":{}, 
"data":{"filterFields":{}, "pageInfo":{}, "user_id": "john", "user_name":"John Smith", "password":"123", 
"role":"role_basic", "action":"insert", "manager_x_schema":{"ws":["1","2"],"ud":["2"]}}}$$);	

Output example

{
  "status": "Accepted",
  "message": {
    "level": 3,
    "text": "User management done succesfully"
  },
  "version": "3.5.002",
  "body": {
    "form": {},
    "data": {
      "info": {
        "geometryType": "",
        "values": [
          {
            "id": 2584,
            "message": "ROLE MANAGEMENT"
          },
          {
            "id": 2585,
            "message": "-------------------------------------------------------------"
          },
          {
            "id": 2586,
            "message": "INFO: User john created in a database"
          },
          {
            "id": 2587,
            "message": "INFO: Role role_basic granted."
          },
          {
            "id": 2588,
            "message": "INFO: User john inserted into cat_users of schema ws."
          },
          {
            "id": 2589,
            "message": "INFO: User john inserted into expl and state selectors of schema ws."
          },
          {
            "id": 2590,
            "message": "INFO: User john inserted into cat_users of schema ud."
          },
          {
            "id": 2591,
            "message": "INFO: User john inserted into expl and state selectors of schema ud."
          }
        ]
      },
      "point": {},
      "line": {},
      "polygon": {}
    }
  }
}