Akita Noek
99d3481976
Ported ad_hoc.py tests to use new RBAC system
2016-03-16 13:46:48 -04:00
Akita Noek
9e79cf733f
Added missing permission grants on a Inventory updater and executor roles
2016-03-16 13:46:15 -04:00
Akita Noek
55564cc2b4
Fix Credential admin_role to add itself under the user.admin_role when it exists
2016-03-16 13:16:26 -04:00
Akita Noek
75b8b0f4a6
Merge branch 'rbac' of github.com:ansible/ansible-tower into rbac
2016-03-16 11:58:46 -04:00
Akita Noek
46cb51ba2f
typo fix
2016-03-16 11:56:58 -04:00
Akita Noek
c308c07579
Removed Permission reference in the activity stream query
2016-03-16 11:37:21 -04:00
Akita Noek
598d5ba5ef
Fixed up JobAccess.get_queryset to use new RBAC system
2016-03-16 11:36:19 -04:00
Akita Noek
8d439c9468
Fixed up AdHocCommandAccess to not use old Permission query
2016-03-16 11:21:19 -04:00
Akita Noek
60fcbd78f1
Another users -> members_role.members fix
2016-03-16 10:54:35 -04:00
Akita Noek
65719615c4
Team users list update for .users -> .member_role.members
2016-03-16 10:40:31 -04:00
Akita Noek
460a14705a
Updated the org users and org admins api list endpoints to use new member_role.members
2016-03-16 10:29:12 -04:00
Akita Noek
7ec3b3b8b5
Fixed up User.accessible_objects to return a User queryset
...
Was returnning a RolePermission qs, needed to be a User qs to match.
Also bolted on the role_permissions GenericRelation so we could just
reuse the ResourceMixin accessible_objects code
2016-03-16 10:26:53 -04:00
Akita Noek
9909ea90c1
Fixed post delete behavior for roles, added test
2016-03-16 09:13:33 -04:00
Akita Noek
67b37e17cb
flake8 fixes
2016-03-16 08:54:59 -04:00
Akita Noek
8625edfec7
Merge branch 'rbac' of github.com:ansible/ansible-tower into rbac
2016-03-15 17:02:16 -04:00
Akita Noek
7e0d2e6729
more .users -> member_role.members
2016-03-15 17:00:20 -04:00
Akita Noek
defe4a4fd8
Made credentials accessible by system administrators and auditors
2016-03-15 16:51:44 -04:00
Akita Noek
ce669b03ad
Switched to a nicer contextmanager implemenation for role hierarchy rebuild batching
...
#1206
2016-03-15 15:30:43 -04:00
Akita Noek
e45982b011
Signal bindings to add permissions from hosts to groups/inventory
...
We should probably move this into a more generic system.. but for the
time being this works, we can refactor later if we have a similar need
elsewhere.
2016-03-15 14:47:36 -04:00
Akita Noek
b499555be4
Added auto_generated flag for RolePermissions
2016-03-15 13:36:28 -04:00
Akita Noek
ea9642f5df
Fixed missing .distinct() necessary for '&'
2016-03-15 13:06:24 -04:00
Akita Noek
e0e3954a8a
Fixed missing accessible_objects permission parameter
2016-03-15 13:05:58 -04:00
Akita Noek
f55d5d90f2
Merge branch 'rbac' of github.com:ansible/ansible-tower into rbac
2016-03-15 11:53:07 -04:00
Akita Noek
b380641e0e
Merge branch 'rbac' of github.com:ansible/ansible-tower into rbac
2016-03-15 11:46:27 -04:00
Akita Noek
721b95cf99
Dummy data generation script
...
Usage: ./manage.py generate_dummy_data --help
2016-03-15 11:45:56 -04:00
Akita Noek
d6429eb1e8
Active flag removal fix for .filter->all
2016-03-15 09:47:53 -04:00
Akita Noek
a845d5c0bb
we removed our previous 0008 migration, so moving 0009 -> 0008
2016-03-15 09:34:50 -04:00
Akita Noek
6ea99583da
Mass active flag code removal
2016-03-15 09:29:55 -04:00
Akita Noek
ba833d683e
Active flag removal: switched from using mark_inactive to delete calls
2016-03-15 09:29:28 -04:00
Akita Noek
1e7c71edfb
active flag removal in migration functions
2016-03-15 09:29:28 -04:00
Akita Noek
ddf3265bd2
Reordered system job template migration to happen after rbac migrations
...
The system job template migration creates SystemJobTemplate instances,
which necessarily depend on the RBAC modifications.
2016-03-15 09:27:06 -04:00
Akita Noek
26f73fa68e
Remove active flag from ever getting created in the rbac models
2016-03-15 09:26:31 -04:00
Akita Noek
4825b2a6fc
Do cleanup_deleted on migrate. Re-ordered active flag removal to be before system job template creation.
...
Also removed active flag deletes from remaining cleanup_deleted
management command as they will no longer be needed - but the
deletes of the authentication tokens as well as potentially disabled
users are still necessary, so the cleanup_deleted command will continue
to exist.
Reordering of the active flag removal to happen before the system job
template creation is necessary since the system job template creation
hits the license checker which at some point runs queries that depend on
the active flag, and with that code changing to not use the active flag,
we need to do the removal before we run this code.
2016-03-15 09:26:31 -04:00
Akita Noek
ec59330465
Active flag removed from Primordial Base Class
2016-03-15 09:26:31 -04:00
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