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
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
1e1a023d19
Obey no_log with ansible 2.0
...
Fixes #645
2016-01-20 15:11:49 -05:00