Commit Graph

32 Commits

Author SHA1 Message Date
Sami Jaktholm
fe2772e9db fix: commit saml user group assignment to the database
Relevant tests were also modified to reload the user
object from the database before asserting that the
user belongs to correct groups.

Fixes #1668.
2018-01-20 15:19:03 +02:00
Jannis Leidel
9f6b4fbdf2
Add full text search for queries based on the Postgres tsvector type. 2018-01-08 22:46:53 +01:00
Mike Fiedler
be232543d6
Use a custom EmailType/CaseInsensitiveComparator
sqlalchemy doesn't appear to have a case sensitive column, so we craft a
type that can have the semantics of case insensitive comparison.

Ref http://docs.sqlalchemy.org/en/rel_1_1/orm/extensions/hybrid.html#building-custom-comparators

Signed-off-by: Mike Fiedler <miketheman@gmail.com>
2017-10-10 18:32:00 -04:00
Mehmet Emin INAC
6d2337b332
Revoke permission should respect to given grantee and access type.
The issue is, if you try to revoke the permission of a user from an
object, all the permissions on this object get removed. The fix is
assigning filtered query object to it's own reference.

According to SQLAlchemy documentation, `filter` method applies to
the **copy** of the query object which means calling filter doesn't
affect the object receiving filter call. For more information;
http://docs.sqlalchemy.org/en/latest/orm/query.html#sqlalchemy.orm.query.Query.filter
2017-10-06 12:52:35 +02:00
Arik Fraimovich
fbd3b92ba0 Fix: delete data source doesn't work when query results referenced by queries. 2017-06-02 18:11:34 +03:00
Arik Fraimovich
6cf1c1cb70 Disable query version check in test (#1550) 2017-01-26 22:25:12 +02:00
Arik Fraimovich
7e43e54b9d Revise Query.by_user method 2017-01-25 18:08:29 +02:00
Arik Fraimovich
c900e83bd9 Fix #1499: queries search should be case insensitive 2017-01-02 11:28:23 +02:00
Arik Fraimovich
c380596930 Fix cases where we used User.groups instead of User.group_ids 2016-12-08 16:02:51 +02:00
Arik Fraimovich
0c974bd48b Update User.find_by_email to SQLA 2016-12-07 12:02:31 +02:00
Allen Short
9b5aaa787d test_permissions, test_changes, test_queries 2016-12-07 02:13:20 -06:00
Allen Short
271b468bcb test_alerts 2016-12-07 02:13:20 -06:00
Arik Fraimovich
9c1450f4c9 Fix users handlers tests 2016-12-07 02:13:20 -06:00
Arik Fraimovich
d59299b85a Fix Alert model tests 2016-12-07 02:13:20 -06:00
Allen Short
24217d969e schema for sqlalchemy, basic test support 2016-12-07 02:13:20 -06:00
yohei.naruse
8c78252ea2 fix tests 2016-11-11 02:21:30 +09:00
yohei.naruse
1ad0c9c75f fix errors 2016-11-09 00:37:16 +09:00
yohei.naruse
1d486938c1 fix bugs 2016-11-06 03:05:47 +09:00
yohei.naruse
e5665879bd add query fork to models.py 2016-11-06 03:02:11 +09:00
Arik Fraimovich
6c5dd09a78 Add change tracking and fix tests 2016-10-26 16:09:55 +03:00
Arik Fraimovich
6218421266 Tests for the permissions API (and rewrite) 2016-10-26 10:52:24 +03:00
Arik Fraimovich
edea6f3a05 WIP:
- Move version/change tracking logic to mixins (the change mixin is still WIP).
- Tests for queries update API.
2016-10-24 16:58:30 +03:00
Arik Fraimovich
857caab20e Merge pull request #1085 from getredash/feature/pause-api
Feature: API to pause a data source
2016-05-31 09:08:03 +03:00
Arik Fraimovich
59f8af2c44 Switch to Redis for pause state storage 2016-05-30 22:44:09 +03:00
Arik Fraimovich
9538ee7c31 Feature: API to pause a data source 2016-05-30 18:30:05 +03:00
Arik Fraimovich
07d2b5ba42 Fix #1049: duplicate alerts 2016-05-30 14:39:58 +03:00
Arik Fraimovich
298db14bc1 API to create api key for dashboards 2016-03-10 10:09:26 +02:00
Jeff Widman
c198d22691 Format files to end in a single newline per PEP 8 2016-02-29 12:00:03 -08:00
Arik Fraimovich
491e2e10d1 Fix test 2016-02-23 15:02:49 +02:00
Arik Fraimovich
eed3d50372 create data source with default group specific method 2016-01-12 15:10:03 +02:00
Arik Fraimovich
901cf6f017 Fix: new data source should be assigned to default group? 2016-01-12 13:39:54 +02:00
Arik Fraimovich
f7b57fa580 Feature: new permissions system
This is one huge change for the permissions system and related:

* (Backward incompatible:) Remove the table based permissions in favour of the new model.
* Manage permission to view or query datasources based on groups.
* Add the concept of Organization. It's irrelevant for most deployments, but allows for
  multi-tenant support in re:dash.
* Replace ActivityLog with Event based rows (old data in activity_log table is retained).
* Enforce permissions on the server-side. There were some permissions that were only enforced
  on the client side. This is no more. All permissions are enforced by the server.
* Added new permission: 'super-admin' to access the status and Flask-Admin interface.
* Make sure that html is never cached by the browser - this is to make sure that the browser
  will always ask for the new Javascript/CSS resources (if such are available).
2015-12-31 10:43:33 +02:00