Database patch and other minor patches and control documentation

Поиск
Список
Период
Сортировка
От Harshal Dhumal
Тема Database patch and other minor patches and control documentation
Дата
Msg-id CAFiP3vwb-m6GyZwBPvoXPvcLS94NyrLfeQfA04UwAeBiuGeDng@mail.gmail.com
обсуждение исходный текст
Список pgadmin-hackers
Hi,

Please find the attached patches:

Database node patch (depends on privilege_macro, node_ui_typo, variable_js patches)

How to use controls:

1] Privilege control:

   a] Data expected from server in following format:
      eg:
     {grantee: public, privileges: Tc* , grantor: postgres} should be converted to below object

  (data parsing logic can be found in databases/__init__.py and browser/utils.py)
"<model_key>": [{"grantor": "postgres",
 
"privileges": [
{"with_grant": false,
"privilege_type": "T",
 
"privilege": true
},
{"with_grant": true,
"privilege_type": "c",
"privilege": true
}],
"grantee": "public"
}]
  b] Privilege control field schema:
     When using this control extend PrivilegeRoleModel with actual privileges you want to show in your control.
    See privilege.js for all supported privileges and their mapping.
{
id: 'datacl', label: '{{ _('Privileges') }}', model: pgAdmin.Browser.Node.PrivilegeRoleModel.extend(
{privileges: ['C', 'T', 'c']}), uniqueCol : ['grantee', 'grantor'],
editable: false, type: 'collection', group: '{{ _('Security') }}', mode: ['properties', 'edit', 'create'],
canAdd: true, canDelete: true, control: 'unique-col-collection',
}



2] Variable control:

   a] Data expected from server:

"variables": [{"database": "db", "value": "ser", "name": "application_name", "role": "postgres"}, {"database": "db"
, "value": "on", "name": "enable_seqscan", "role": "postgres"}]
 b] Variable control field schema:
 Note: database and role fields are optional are not included in variable control unless specified in field schema.
 Use below flag to enable them
 
hasDatabase: true and hasRole:true   (both can not be used at same time)

(In below example you can see hasRole:true as I need role field in variable control for database node)
{
id: 'variables', label: '{{ _('Variables') }}', type: 'collection',
model: pgAdmin.Browser.Node.VariableModel, editable: false,
group: '{{ _('Security') }}', mode: ['properties', 'edit', 'create'],
canAdd: true, canEdit: false, canDelete: true, hasRole: true,
control: Backform.VariableCollectionControl, node: 'role'
}


Let me know if you have any queries regarding how to use above contorls.

-- 
Harshal Dhumal
Software Engineer 



Вложения

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Surinder Kumar
Дата:
Сообщение: Re: [pgAdmin4] [Patch]: Extension Module
Следующее
От: Ashesh Vashi
Дата:
Сообщение: pgAdmin 4 commit: Resovled a typo in rendering the NodeAjaxOptionsCell