Commit Graph

303 Commits (0b434431514dd898086ef69079d76ed3eb758ec8)

Author SHA1 Message Date
Ashesh Vashi 0b43443151 Allow the connection driver to return notices/messages from the server. 2016-03-04 10:35:50 +00:00
Harshal Dhumal d2e372114b Security Label and ACL template macros:
Way to use in template:

1) Security labels:

SECLABLE.SET(conn, object_type, object_name, provider, security_label,
object.schema)

SECLABLE.UNSET(conn, object_type, object_name, provider, object.schema)

2) Privileges:

PRIVILEGE.SET(conn, object_type, grantee, object_name,
privileges_without_grant, privileges_with_grant,
            object.schema)

PRIVILEGE.UNSETALL(conn, object_type, grantee, object_name, schema)

privileges_without_grant = comma separated string of privileges.
privileges_with_grant = comma separated string of privileges.
2016-03-03 15:12:37 +00:00
Khushboo Vashi 3ff06da772 Security Labels, Privileges and Variables macros for the functions modules.
Usage of the macros:

Security labels:

SECLABLE.SET(conn, 'FUNCTION', func_name, provider, security_label, func_schema, func_args)

SECLABLE.UNSET(conn, 'FUNCTION', func_name, provider, func_schema, func_args)

Privileges:

PRIVILEGE.SET(conn, 'FUNCTION', grantee, func_name, privileges_without_grant, privileges_with_grant, func_schema, func_args)

PRIVILEGE.UNSETALL(conn, 'FUNCTION', grantee, func_name, func_schema, func_args)

Variables:

VARIABLES.SET(conn, 'FUNCTION', func_name, options, func_schema, func_args)

VARIABLES.UNSET(conn, 'FUNCTION', func_name, options, func_schema, func_args)
2016-03-03 14:08:28 +00:00
Khushboo Vashi 789ece89fb In the current Backgrid implementation, a cell can be made editable through "editable: true/false" settings. It takes only a boolean value.
Add support for a function that can be set as an editable option value.

For Example:

editable: function(m) { return false; }
2016-03-03 14:03:59 +00:00
Akshay Joshi e138ec53b6 Add support for asynchronous connections to the database server. 2016-03-02 13:29:15 +00:00
Ashesh Vashi b41066a6b6 [Reversed Engineered SQL] Security Labels is not available for PostgreSQL <= 9.1 2016-03-01 15:36:52 +05:30
Ashesh Vashi cf170821cb Security Labels is not available for PostgreSQL <= 9.1 2016-03-01 11:06:31 +05:30
Ashesh Vashi 1cb2a054ff Showing consitent reversed engineered SQL for the database node. 2016-03-01 10:42:04 +05:30
Ashesh Vashi a6466c091c Resolved a regess of the previous commit, which introduced during
previous commit: 39d432ca2c.

[Thanks Neel Patel for pointing this out..]
2016-03-01 10:24:46 +05:30
Ashesh Vashi 39d432ca2c Remove some unnecessary imports from the pgadmin/__init__.py, and
removed the file hooks.py, which is not used any more with new
infrastructure.
2016-02-29 23:08:08 +05:30
Neel Patel 000c76871f Updated the misc module javascripts to work with latest wcDocker. 2016-02-29 19:37:24 +05:30
Ashesh Vashi 18d767b107 Updated the wcDocker to make use of wcSplitter (new functionalities),
which will be used by the debugger tool.

Updating the wcDocker from the repository -
'https://github.com/WebCabin/wcDocker' up to commit-id:
0f5690318ce0bf457fdd374dcec7418d22b72e22
2016-02-29 19:36:51 +05:30
Ashesh Vashi 54edb4b482 Resolved a typo in variable name in the database/utils.py 2016-02-29 10:44:57 +05:30
Ashesh Vashi 3051e7cd62 Log the exception loading the module script on the console. 2016-02-28 17:05:50 +05:30
Ashesh Vashi f8a45799b6 Resolved an issue related to adding menus dynamically using the jinja2
templates. The variable scope for the jinja2 template variable is not
consitent across all the for loop (loop withing loop), it was behaving
inconsistently, a value set in a loop was not properly accessible in
inner loop properly. In order to resolve the issue - setting/using the
variable only in inner loop, and call add_menus function multiple times,
which we were trying to avoid, but - we can live with that.
2016-02-28 17:00:52 +05:30
Ashesh Vashi b85f9e6d1a Creating an empty pgAdmin module container (named tools) for keeping
all the sub-modules of type tools.
2016-02-28 12:49:36 +05:30
Ashesh Vashi 2bf8eccb67 Pass the tree item (missing from the code) for making it inode agai. 2016-02-28 12:15:08 +05:30
Ashesh Vashi 2d7a218792 Resolved few issues with browser.js:
(dynamic menu generation, typo in error message)

- Dynamic menu generation code was failing for some corner cases.
- Removed trailing whitespaces.
- Resolved a typo in the message - 'click_for_detailed_msg', which was
  resulting in '{}' message instead of actual error message.
2016-02-28 12:15:08 +05:30
Ashesh Vashi 41e85fd631 Make the default privileges jinja2 template macros to generate more
consistent SQL.
i.e.
Put 4 spaces after every new line (wherever required).
2016-02-28 12:15:08 +05:30
Khushboo Vashi d4a13eaafa Security Labels and the Variables are used in many modules under the Database Node.
Provide functions in the database node to handle them.
2016-02-26 15:21:55 +00:00
Akshay Joshi b3ff96d2db Add backgrid extensions for use in various tools: select-all, paginator and filter 2016-02-26 11:08:45 +00:00
Dave Page 3b2ef2961b Correct error message to match the field name. 2016-02-25 16:47:07 +00:00
Dave Page af25a11dde Correct spelling of SECLABEL 2016-02-25 16:41:11 +00:00
Dave Page f0e7bd91cb Improve warning message 2016-02-25 11:58:02 +00:00
Dave Page f3813239c0 Fix rule name generation 2016-02-25 11:14:34 +00:00
Dave Page de9e122a91 Fix typo 2016-02-25 10:39:04 +00:00
Surinder Kumar c950683fa1 Add support for extensions. 2016-02-24 16:45:35 +00:00
Sanket Mehta f466e0169a Add support for casts. 2016-02-24 16:44:37 +00:00
Dave Page 0b1cf1ad2c Remove an unnecessary line ending. 2016-02-24 16:42:38 +00:00
Ashesh Vashi f4ae7cd210 Resolved a typo in the node creation SQL template for PostgreSQL 9.2. 2016-02-24 15:00:25 +05:30
Akshay Joshi 7ffbb8c039 Add support for viewing/editing procedural languages. 2016-02-23 10:07:14 +00:00
Dave Page 2de7b4c0a0 Improve Resource Group labels per discussion with Jason. 2016-02-23 09:08:46 +00:00
Akshay Joshi c153032e3b Add support for displaying dependency and dependents info. 2016-02-22 13:07:16 +00:00
Harshal Dhumal 0b956813d4 public in the privilege control should not be allowed to select the
'WITH GRANT' options.
2016-02-22 17:36:23 +05:30
Akshay Joshi 8186e45844 Adding Numeric control support for Backform.
This patch also includes an issue related to IntegerControl, which does
not emit any error message, when it has some issues.

In order to fix the issue, it will trigger 'pgadmin-session:invalid'
event, when the input value is not an valid integer.
2016-02-22 17:18:08 +05:30
Ashesh Vashi 6c2faa984b Do not need to implement the BackendSupported function in resource
group, we do have the same function in CollectionModule class, which
will work, when we set the min_ver, max_ver and server_type properly.

Thanks Khushboo for pointing that out, and Akshay for quick testing for
this patch.
2016-02-22 17:04:06 +05:30
Ashesh Vashi db9b5f0e0c Resolved the issue related showing errors in the radio control. 2016-02-22 17:00:17 +05:30
Akshay Joshi dafd2f3323 Add support for Resource Groups in EDB Advanced Server 9.4+. 2016-02-22 10:51:35 +00:00
Ashesh Vashi c3b0e1dec4 Returns an error when the driver couldn't decrypt the password, and
let the user know the issue.
2016-02-22 14:03:07 +05:30
Ashesh Vashi bbf037f005 Resolved a typo in Server Module related to assigning manager object to
driver variable.
2016-02-22 14:01:16 +05:30
Ashesh Vashi d5da26876b Resolved few issues (with some improvements) with existing nodes.
This commit takes care of the following issues/improvements.
* Adding missing imports for unauthorised in database module
* Node under Servers Nodes (i.e. Databases, tablespaces, roles nodes)
  need to be inherited from PGChildNodeView (and, not from NodeView) for
  adding server version check for their children.
* Adding statistics for database, and tablespaces in its node (not, yet
  in UI)
* Renaming the camel case methods with proper name.
  (i.e. getSQL -> get_sql, getNewSQL -> get_new_sql, etc.)
* Fixed the functions going beyond the text limit (column: 80) in
  Databases, Roles & Tablespaces modules.
* Fixed the node method of Database module, which was not tested ever.
* We do not need separate SQL template for fetching the name (i.e.
  get_name.sql), using the 'nodes.sql' for the same.
* Optimise the query for fetching ACLs for the database node, we didn't
  require to join certain tables, while fetching only the ACLs.
* Introduced the list of the ACLs (regular and default ACLs for
  different type) supported by each version [Databases Module].
* Renamed the templates 'get_nodes.sql' to' nodes.sql' to make it
  consistent with other modules.
* Removed the checks for the authentication table use, as we don't need
  to expose the password to the users (even the encrypted MD5). Using
  the pg_roles view always for fetching roles/users information now.
* Resolved some typos in unreachable (specially the exceptions
  catchment area.)
* Logging the exception in the application.
* Using qtLiteral, qtIdent properly in the templates (do not assume
  about the types of data.)
* Using tsid as identifier instead of did for the tablespaces.
* Using nodes method of tablespace view for fetching individual node
  information.
* Removing the hardcoded node information from the 'parse_priv_to_db'
  function, and pass on allowed ACLs by the caller nodes.
* Using 'nodes.sql' to fetch name of the template instead of writing
  that in the delete.sql template, which is definitely wrong place to
  fetch the name of the object. [Tablespace Module]
2016-02-22 11:44:24 +05:30
Harshal Dhumal a3d23a65bb Disconnect the database connection only once not every time before
running the offline queries i.e. renaming of the database, using
different tablespce for the database, etc.
2016-02-18 17:08:24 +05:30
Ashesh Vashi 3d134a3d07 Initialize (executing the constructor) for the PGNodeModule needs to be
called while initialing the CollectionNodeModule, as
super(..).__init__(..) does not call __init__ function of all parent
classes. Please refer to method resolution order (MRO) in python for
more information.

This patch also includes some typo resolution in PGNdoeModule. Also,
removed the AddAttr(..) at the moment, because - it is not going
anywhere at the moment.
2016-02-18 17:08:24 +05:30
Dave Page 2233583dbd Avoid unnecessary redraws of the SQL pane. 2016-02-17 10:43:02 +00:00
Dave Page 131043d7cb Don't ask before connecting to servers or databases, just do it like pgAdmin 3. 2016-02-12 16:46:56 +00:00
Dave Page 47fc43c23f Don't add (GROUP) to the end of group role names; that's denoted by the icon. 2016-02-12 16:39:56 +00:00
Ashesh Vashi 639a3ed0ac Fixes the qtIdent function in the psycopg2 driver about not taking care
of double quote within it.

The 'replace' function of immutable type string do create a new
instance of type string, which needed to be reassgined to the variable
'value'.

Reported By: Murtuza Zabuawala
2016-02-10 15:00:52 +05:30
Khushboo Vashi b32496f71a Allow to use the select2 with multiple selection. Changed the formatter
used by NodeAjaxOptions Family controls to takes care the data returns
by these controls.
2016-02-10 13:09:09 +05:30
Murtuza Zabuawala a02b1a4813 Adding validation for the previleges control. 2016-02-10 13:01:14 +05:30
Murtuza Zabuawala dc51baefcc Adding more jinja2 template macros for the default previleges. 2016-02-10 13:00:19 +05:30