Commit Graph
94 Commits
Author SHA1 Message Date
Akita Noek ab23e983f8 More team/org users/admins -> member_role/admin_role updates 2016-03-14 17:00:59 -04:00
Akita Noek c9b0625e39 More accessible_objects -> objects + filter 2016-03-14 16:50:52 -04:00
Akita Noek 05b98d4904 Removed accessible_objects filter from ActivityStream get_queryset 2016-03-14 16:32:59 -04:00
Akita Noek 495b5b9341 project test case fix, missing pytest marker 2016-03-14 16:28:57 -04:00
Akita Noek 6549a0225b Various org.admins -> org.admin_role.members transformations 2016-03-14 16:28:24 -04:00
Akita Noek 0c0ed45b44 Removed api/v1/projects/N/organizations as it is no longer relevant
Also added 'organization' related field to the project
2016-03-14 16:26:15 -04:00
Akita Noek 7cf28e2f03 More project migration fixes 2016-03-14 16:01:12 -04:00
Akita Noek 9146b29770 Fix up some project multi-org -> single-org fallout 2016-03-14 15:31:05 -04:00
Akita Noek 820ed0b747 Merge branch 'rbac' of github.com:ansible/ansible-tower into rbac 2016-03-14 15:05:01 -04:00
Akita Noek ba6752fb23 Eliminate multiple-organization projects
Projects are duplicated with this migration to provide a nearly
equivalent functionality.

Satisifies #1164
2016-03-14 14:57:24 -04:00
Akita Noek 97a6f23380 Fixed up migrations after last merge 2016-03-09 13:08:02 -05:00
Akita Noek 9d4e6dfc16 Merge branch 'devel' of github.com:ansible/ansible-tower into rbac 2016-03-09 12:04:05 -05:00
Akita Noek 9c78a85a70 Removed old test assertion 2016-03-09 12:03:20 -05:00
Akita Noek 1989012fd5 Moved access_list url to <whatever>/id/access_list
Eg: organizations/1/access_list will now return a list of all users who
have access to that organization.

This replaces our initial implementation which was resources/id/access_list
2016-03-09 11:41:42 -05:00
Akita Noek efcd4efda2 Moved the rbac field removal migration to happen after the migrate script part of the rbac migration 2016-03-09 11:31:00 -05:00
Akita Noek 87219135af Removed unneeded import 2016-03-09 10:39:31 -05:00
Akita Noek b486c8d658 Merge branch 'rbac-resource-gfk' into rbac 2016-03-09 10:17:58 -05:00
Akita Noek 9aae2979d9 Replaced our 'Resource' table with a GenericForeignKey in RolePermission 2016-03-09 10:12:05 -05:00
Akita Noek e9c3d98a44 Merge branch 'devel' of github.com:ansible/ansible-tower into rbac 2016-03-04 14:02:01 -05:00
Akita Noek 5a31804330 Just use num_pages when we're at the end of a nav list 2016-03-04 13:37:07 -05:00
Akita Noek e28eec4a56 Fix missing semicolons 2016-03-04 11:37:47 -05:00
Akita Noek cf5d718fa8 Fixed pagination nav issue
Fixes #1021
2016-03-04 11:36:57 -05:00
Akita Noek db6117a56d Added role description fields
Completes #1096
2016-03-03 16:19:10 -05:00
Akita Noek 048e65eab3 Add test to help detect incorrect role rebuilding 2016-03-03 13:54:45 -05:00
Akita Noek c15d48a640 Locked down user/team role listing and role membership management api endpoints 2016-03-02 16:36:16 -05:00
Akita Noek 9699f34976 Made org admin role a parent of org member role so admins pick up everything members are granted 2016-03-02 09:44:55 -05:00
Akita Noek 444aed1ab2 Switch make init to use manage.py directly instead of awx-manage, saves from having to install in order to do an init 2016-03-01 15:37:00 -05:00
Akita Noek 3db13bc33c Updated fact tests to use the divergent group fixture
A group fixture was created in different ways, one on devel and one on
rbac, this patch just normalizes to the one usage
2016-03-01 15:34:26 -05:00
Akita Noek 2c690c82d9 Renamed rbac migrations to be after the notification and fact migrations 2016-03-01 15:34:06 -05:00
Akita Noek c6c176cb5c Merge branch 'devel' of github.com:ansible/ansible-tower into merge-devel 2016-03-01 15:10:07 -05:00
Akita Noek ea2cabe4d4 Merge branch 'devel' of github.com:ansible/ansible-tower into merge-devel 2016-03-01 15:09:58 -05:00
Akita Noek f5e311f5ac Undo some more automatic work that we're suppsoed to test with our migrations 2016-03-01 09:56:43 -05:00
Akita Noek 41c06dc2d0 Update user migration to not bomb out when a UserResource already exists for a user 2016-03-01 09:54:35 -05:00
Akita Noek 73dc061716 Patch up our credential migration tests to undo some automatic work that needs to be done in the migration 2016-03-01 09:47:26 -05:00
Akita Noek e94d441fb0 Add support for following parental changes on save and delete in the RBAC system 2016-02-29 16:59:20 -05:00
Akita Noek 9c1694f187 Added resource type to our roles in our access list 2016-02-26 10:46:01 -05:00
Akita Noek 5bb241bfd4 Added resource name and related field to the roles listed in an access_list 2016-02-26 10:42:07 -05:00
Akita Noek 4724d0c067 Merge branch 'devel' into rbac 2016-02-25 13:05:59 -05:00
Akita Noek 46e1839ab1 Merge branch 'rbac' of github.com:ansible/ansible-tower into rbac 2016-02-24 16:14:41 -05:00
Akita Noek e18592fa87 Merge branch 'devel' into rbac 2016-02-24 16:14:32 -05:00
Akita Noek 384b8b9542 Added 'resource_access_list' related field to resources 2016-02-23 16:11:34 -05:00
Akita Noek 606501749c Added several related fields to the RBAC API 2016-02-23 11:49:53 -05:00
Akita Noek 9be9cf9b72 Fixed RBAC migration tests considering new signal handlers that are a bit too helpful during testing
We have some signal handlers now that perform work that do work
automatically that we want to explicitly test in our migration path, so
we have to undo some things in order to test the migration code.
2016-02-22 16:50:13 -05:00
Akita Noek 73b2105a30 Switch to using const's for system admin / system auditor singleton names 2016-02-22 16:27:11 -05:00
Akita Noek 26dc430c59 Look for and report on transaction errors within our implicit RBAC fields
When a transaction is in a failed state these fields will not be able to
create new role/resource entries. This check just makes it easier to see
what's going on and aids in debugging.
2016-02-22 16:25:09 -05:00
Akita Noek b08809f7cc Initial RBAC API implementation 2016-02-22 16:21:56 -05:00
Akita Noek dce474ec5e get_absolute_url implemenation for Role 2016-02-22 14:55:32 -05:00
Akita Noek 5071dba4ff Moved RBAC get_permissions implemenation to the Resource model
I had need to perform this query right on a Resource, so I moved it from
the mixin to the Resource
2016-02-22 14:54:27 -05:00
Akita Noek 7d4b54a651 Fixed __all__ def 2016-02-22 14:52:57 -05:00
Akita Noek 0ff94e424d SubList views can now resolve deep relationships using dot notation for relationship specification
Made it so you can specify a relationship like 'parent.somelist'
2016-02-22 11:07:32 -05:00
Akita Noek 1e1f49c3eb Initial unit tests for core rbac functionality 2016-02-22 09:44:00 -05:00
Akita Noek 80476cbb2a Automatically add/remove user to the member_role when a user is added to / removed from a team 2016-02-22 09:44:00 -05:00
Akita Noek 161f4f22cf Merge branch 'devel' of github.com:ansible/ansible-tower into merge-devel 2016-02-22 09:37:14 -05:00
Akita Noek 0051464525 Added put,head,options,delete, & patch test fixtures for api related tests 2016-02-18 11:23:31 -05:00
Akita Noek 6aeaec2b76 Switch to resolve in api test fixtures to automatically resolve View's and their arguments
Also changed the signature of the post/get methods to better align with
libraries like `requests`
2016-02-18 11:19:27 -05:00
Akita Noek 409c7baa33 doc: Removing .svg for our example image
Apparently .svg's don't work in github markdown
2016-02-12 11:08:08 -05:00
Akita Noek 0ef004171d doc: Try PNG for github markdown instead of SVG 2016-02-12 11:07:31 -05:00
Akita Noek a4c435c14e doc: Added an example RBAC picture 2016-02-12 11:02:12 -05:00
Akita Noek 76c2454936 Docs: Added RBAC basic concepts section 2016-02-12 10:44:53 -05:00
Akita Noek 319252f555 Finish removing our raw SQL implemenations from our mixins
Boiled out our current-best ORM implemenations. These can likely be
optimized further, but are adequate for the time being.
2016-02-12 10:16:29 -05:00
Akita Noek 72419f7eb9 Generically handle automatic role rebinding through m2m relations 2016-02-11 16:59:32 -05:00
Akita Noek 9a3ef6b998 ORMified RBAC classes; Added GenericForeignKey backref for convenience
The RoleHierarchy table has been eliminated in favor of just using
a ManyToMany map, which is what we should have been using all along.

ORMifications still need improvement, in particular filtering on
ResourceMixin.accessible_by should reduce permission calculation
overhead, but with the current implemenation this is not true.
ResourceMixin.get_permission performs adequately but not as good
as it can yet.
2016-02-11 16:18:44 -05:00
Akita Noek ac7d50048c Removing unused resource_parent
Forgot to remove these bits when we removed the concept a few commits
ago
2016-02-11 16:18:44 -05:00
Akita Noek 29f8d6b778 Merge branch 'devel' of github.com:ansible/ansible-tower into rbac-devel-integration 2016-02-09 09:47:29 -05:00
Akita Noek a03d48eeb7 Add member_role to organizations 2016-02-08 22:54:19 -05:00
Akita Noek a2b9777cc7 Add migrate_users and migrate_projects to our migration plan 2016-02-08 22:54:19 -05:00
Akita Noek 34067d9c0e Project migration and tests 2016-02-08 22:54:19 -05:00
Akita Noek d51447e158 Migration and tests for super users 2016-02-08 22:54:19 -05:00
Akita Noek 5008e3faf5 Add parent System roles to organization roles 2016-02-08 22:54:19 -05:00
Akita Noek f7dc3c0f0d Added an explicit member role, distinct from auditor role 2016-02-08 22:54:19 -05:00
Akita Noek 70229076d2 Removed unnecessary ResourceHierarchy model 2016-02-05 17:03:59 -05:00
Akita Noek fe29486d7b Removed unnecessary save() 2016-02-05 17:01:19 -05:00
Akita Noek 619e5797d4 RBAC inventory migration tests 2016-02-05 16:59:38 -05:00
Akita Noek d5740408e9 Addd inventory fixture 2016-02-05 16:59:22 -05:00
Akita Noek 9f33835582 Added RBAC migration code 2016-02-05 16:58:41 -05:00
Akita Noek 332b8b3b49 Added Role.is_ancestor_of predicate 2016-02-05 16:58:16 -05:00
Akita Noek 4540eb0079 Updated role hierarchy cache rebuilder to handle adds to .children as well as .parents 2016-02-05 16:46:00 -05:00
Akita Noek c6b2e509fd Fixed ImplicitRoleField and ImplicitResourceField's from being too lazy
This ensures that the role and resource fields get created and bound
automatically without having to explicitly access them a first time.
2016-02-04 15:12:25 -05:00
Akita Noek 1035a6737e Added singleton role support method and parent_role auto-binder in the ImplicitRoleField
Also fixed bug in the single object permission lookup.
2016-02-04 15:12:25 -05:00
Akita Noek 4d080497cc Updated inventory role/resource model to better match the spec 2016-02-04 15:12:25 -05:00
Akita Noek 1cd8f6f46a Moved m2m signal handler out to our common signals.py 2016-02-04 15:12:25 -05:00
Akita Noek 74163d3711 Added Role.grant method for convenient permission granting 2016-02-04 15:12:25 -05:00
Akita Noek cf298f6803 Single permission query optimization 2016-02-04 15:12:25 -05:00
Akita Noek 5b50ebb8da Added a ResourceMixin to be added to any model that is a "Resource"
Also added initial permissions checking and accessible object methods to
the mixin
2016-02-04 15:12:25 -05:00
Akita Noek 6dad0406b8 Initial implicit role / resource field additions into models
"Completes" #731 until we find out what I missed
2016-02-04 15:12:24 -05:00
Akita Noek 68d8299689 Switched from booleans to integers for permissions flags
This is so that our permissions aggregation query can use MAX(column)
which exists and works in both postgres and sqlite, as opposed to having
some conditional aggregate function that we use depending on our
backend.
2016-02-04 15:12:24 -05:00
Akita Noek 014b970030 Automatically rebuild our role hierarchy when our m2m map is updated 2016-02-04 15:12:24 -05:00
Akita Noek fae9ef3d65 flake8 corrections 2016-02-04 15:12:24 -05:00
Akita Noek 00619b7e36 Initial RBAC field and model definitions 2016-02-04 15:12:24 -05:00
Akita Noek f8a7fb0ea1 Added missing 'skipped' field for no_log 2016-01-28 12:43:49 -05:00
Akita Noek 94e6d2a72a Obey no_log even more when using ansible 2.0
Hopefully fixes #645 this time. New function handles recursing down our
results array when it's present, also attempts to proactively protect
against future data leaks by only allowing white listed fields through.
2016-01-28 11:34:43 -05:00
Akita Noek 39d84c3cda 5% performance boost on make test
Calling `.after` on a dateutil.rrule object that has an UNTIL clause
performs very poorly if the interval is low and the start time is a long
time ago. This patch replaces two test cases where we were using a
minute interval with a fixed start time of (currently) 2 years ago,
which resulted in aproximately 40s of execution time to simply evaluate
`.after(now())`. Replacing these two tests with tests that start from
"yesterday" while keeping the same INTERVAL and UNTIL settings
eliminates this unnecessary slowdown while maintaining the spirit of the
original tests.
2016-01-25 09:37:59 -05:00
Akita Noek de7be08856 Obey no_log with ansible 2.0
Fixes #645
2016-01-20 15:34:59 -05:00
Akita Noek 1e1a023d19 Obey no_log with ansible 2.0
Fixes #645
2016-01-20 15:11:49 -05:00