Commit Graph

25 Commits

Author SHA1 Message Date
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 b499555be4 Added auto_generated flag for RolePermissions 2016-03-15 13:36:28 -04: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
Wayne Witzel III 39a1e893fb Merge branch 'rbac' of github.com:ansible/ansible-tower into rbac 2016-03-07 08:49:48 -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
Wayne Witzel III 380ccec687 started access refactoring, added UserAccess and updated how ALL permissions is checked 2016-03-01 15:01:33 -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 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 aa3a33447e Automatically add users with is_superuser to System Admin role
Also fixed issue with System Admin role name not being set and made some
constants for the singleton names we use
2016-02-22 09:44:00 -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 70229076d2 Removed unnecessary ResourceHierarchy model 2016-02-05 17:03:59 -05:00
Akita Noek 332b8b3b49 Added Role.is_ancestor_of predicate 2016-02-05 16:58:16 -05:00
Wayne Witzel III 7b3f3675f8 flake8 fixes 2016-02-05 09:18:52 -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 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 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