Commit Graph

20 Commits (d508deecec2e941767e9604b1888a1682e1e3dba)

Author SHA1 Message Date
Alirie Gray 0f810debcb Rename org config method Update to Put for semantic accuracy
Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
2018-07-10 15:42:44 -07:00
Alirie Gray 874110bd5e Rename org config receivers and function params to be more conventional
Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
2018-07-10 15:32:23 -07:00
Alirie Gray 92029e5525 Remove unecessary FindOrCreate call in Update in organizations/org_config.go
Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
2018-07-10 14:39:28 -07:00
Jared Scheib ae475c7ae8 Add OrganizationConfigStore & refactor org config to be per org
As previously implemented, OrganizationConfig was a global
object. This refactor adds the organization id to context for
every request, even when auth is disabled, so that org id
can be used to get/update an organization config.

Along those lines, this also removes OrganizationConfigStore
.Initialize and replaces .Get with .FindOrCreate, handling
the creation of organization configs upon first attempted
access.

Co-authored-by: Jared Scheib <jared.scheib@gmail.com>
2018-07-09 17:36:19 -07:00
Michael Desa d8d20547ab Change Organization ID to string from uint64 2017-12-19 10:13:43 -08:00
Michael Desa f8894b7d2d Clarify comment in organization/users Add method 2017-12-14 11:46:51 -08:00
Michael Desa 61ef8937ba Add comment clarifying UsersStore Add method 2017-12-14 11:36:26 -08:00
Michael Desa 1298c2eedc Only promote user to super admin in user org store
Add diff check to Organization UsersStore Add tests

Previously, a users super admin status was disregarded in the Add
facade. This was problematic when new users were added with a super
admin status, because they would not be granted the status. This created
an odd user experiece.
2017-12-14 10:56:23 -08:00
Michael Desa 39b9a90900 Remove organization LayoutsStore 2017-12-05 17:14:21 -05:00
Michael Desa 04f65d1c68 Allow empty Organization on Layouts in Org store
Previously, canned dashboards were global to the application. When
organizations were introduced, we scoped layouts under a specific
organization. This was done without consideration to the `canned`
layouts which are more global than a specific organization and likely
apply an an application level. Since the layout did not have any
organization associated with it, it was filtered out of the list of
results that one would see for `GET /mappings`.

This commit allows users to retrieve layouts that are stored in the
canned store that do not have an organization associated when the user
requests `All` layouts for an organization.

Future work for this is outlined as a comment in the commit.
2017-12-05 12:29:57 -05:00
Jared Scheib e64c072388
Merge pull request #2435 from influxdata/multitenancy_prevent_bad_add_org_user
Prevent unintended update of existing user on Add; fix duplicate User & Org creation client UX
2017-12-04 14:15:27 -08:00
Michael Desa e27936ee69 Add Num to UsersStore interface 2017-11-30 12:55:59 -05:00
Michael Desa afe97e0cec Prevent unintended update of existing user on Add
Previously, the organizations store did not check to see if the user
that a user was being "added" had a role in the organization, it simply
filtered out a users roles that did not belong to that organization and
blindly appended the new ones that were supplied.

This resulted in users being able to change another users role during
new Add request for the same user.
2017-11-29 17:58:42 -05:00
Michael Desa d854d6f8a4 Fix Update method in organization.UsersStore
Previously, when users were updated, we did not use the fields on the
user that was being persisted. As a result, the API responded with the
attribute being set, but the updated values were not actually stored in
bolt. This was not noticed previously because SuperAdmins had raw access
to the UsersStore
2017-11-10 19:06:38 -05:00
Michael Desa 85bb71033c Expose some organization routes to admins
Cleanup tests appropriately

Prevent Admins from patching organizations
2017-11-10 12:48:10 -05:00
Michael Desa 6fbfde5060 Add comments throughout codebase 2017-11-01 12:30:42 -04:00
Michael Desa 3eaca382d3 User explicit type when setting context 2017-11-01 09:49:02 -04:00
Michael Desa 978da16ecd Add org param to New Organizaiton methods 2017-10-31 17:40:58 -04:00
Michael Desa d7d69730d7 Refactor organizations tests to use mocks 2017-10-30 17:03:53 -04:00
Michael Desa 6e0bfa67df Move organization resouces to their own package 2017-10-30 14:31:19 -04:00