Commit Graph

57 Commits

Author SHA1 Message Date
Wayne Witzel III
fd9d05d5df fixing deprecated_team.organization credential migration 2016-08-30 14:21:16 -04:00
Wayne Witzel III
2e4c26a77f remove the ORing of local roles, check against organization roles 2016-05-17 13:56:11 -04:00
Akita Noek
a6f735b4b9 Fixed call to role rebuilder during migrations 2016-04-27 15:27:52 -04:00
Akita Noek
b1e140d83d flake8 fixes 2016-04-22 10:17:21 -04:00
Akita Noek
17120ffe4f Futher optimze role rebuilding to be aware of whether we are adding or removing parentage 2016-04-22 10:17:21 -04:00
Akita Noek
280993a15d Dropped stored role name/description and other superflous fields
For name and description, we'll derive these from the role_field and
content type, which is much better for lots of reasons (eg changing text
the future). Also ditched the rest of the fields comming from the
standard common base model, we didn't use them and they cost several
indexes on the table.
2016-04-22 10:16:04 -04:00
Wayne Witzel III
0309757439 Add parent ORing for Role field, renamed permissions -> active_roles 2016-04-21 15:54:36 -04:00
Akita Noek
5197c1b65a Optimized implicit role creation for new instances of resources 2016-04-19 22:14:38 -04:00
Akita Noek
233ed894d6 Optimized ImplicitRoleField post_delete action 2016-04-19 22:14:38 -04:00
Akita Noek
6d34ca9d22 Proof of concept hacks for RolePermission elimination 2016-04-15 10:03:50 -04:00
Akita Noek
8887db231b Progress on ripping out RolePermissions 2016-04-14 09:44:20 -04:00
Akita Noek
7b4e7ec5b3 Switch to explicitly stored implicit role parents
Completes #1496
2016-04-12 14:50:52 -04:00
Akita Noek
b77d8dab47 flake8 fixes
Signed-off-by: Akita Noek <anoek@ansible.com>
2016-04-12 12:04:39 -04:00
Akita Noek
7d2e660749 Make use of 'current' apps so RBAC ImplicitRoleField can work during migrations
While a migration is taking place, we can't juse use normal model
references like Role and RolePermission, nor can we use generic foreign
keys without manually referring to the content type and object id
fields.
2016-04-12 11:40:17 -04:00
Akita Noek
682552d9b0 Added field deconstruct method so ImplicitRoleField works in migrations
Apparently we need this, who'da known.
https://docs.djangoproject.com/en/1.9/howto/custom-model-fields/
2016-04-12 11:40:17 -04:00
Wayne Witzel III
24e20abb1b more unicode safety 2016-03-31 11:20:19 -04:00
Wayne Witzel III
fa67bd3f0e unicode safety 2016-03-31 10:24:09 -04:00
Akita Noek
7310f9aa44 Be lazier with original parent role computations to avoid unnecessary queries 2016-03-26 09:56:57 -04:00
Akita Noek
d8f527429c flake8 fixes 2016-03-22 08:05:04 -04:00
Akita Noek
ec851492d6 Fixed Role m2m binding so it even works all the time 2016-03-21 21:09:22 -04:00
Akita Noek
23f0286669 Refactored ImplicitRoleField to be faster and avoid some bad looping cases
The role creation logic was a bit too lazy and caused some looping when
using other roles as parent roles. This refactor does all role
creation for a single model instance up front together, which helps
avoid these situations as well as eliminates some extra db updates and
inserts that would happen the old way.
2016-03-18 15:10:08 -04:00
Akita Noek
ccfb73766c Code de-dup 2016-03-17 13:25:04 -04:00
Akita Noek
9909ea90c1 Fixed post delete behavior for roles, added test 2016-03-16 09:13:33 -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
b499555be4 Added auto_generated flag for RolePermissions 2016-03-15 13:36:28 -04:00
Wayne Witzel III
16673b1468 Fix the m2m_changed when accessed reversed 2016-03-11 15:59:01 -05:00
Wayne Witzel III
45483fb057 Refactor m2m_changed so reverse works 2016-03-11 15:18:24 -05:00
Wayne Witzel III
31a461956a Fixed up m2m_changed for rbac, added User.admin_role 2016-03-11 14:59:47 -05:00
Wayne Witzel III
55e071535b Added user role creation, accessible methods, and fixed up m2m_update 2016-03-11 07:07:17 -05:00
Akita Noek
87219135af Removed unneeded import 2016-03-09 10:39:31 -05:00
Akita Noek
9aae2979d9 Replaced our 'Resource' table with a GenericForeignKey in RolePermission 2016-03-09 10:12:05 -05:00
Akita Noek
db6117a56d Added role description fields
Completes #1096
2016-03-03 16:19:10 -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
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
Wayne Witzel III
65c20e9de2 use objects instead of _default_manager 2016-02-18 13:36:36 -05:00
Wayne Witzel III
74e1554463 Only touch the attribute if it does not exist to avoid recursion in activity streams 2016-02-17 11:59:06 -05:00
Akita Noek
e2a428b9f5 Removed resource_field ImplicitRoleField
We just now assume that this field is always named 'resource'

 Completes functionality of #926, documentation next
2016-02-15 12:38:17 -05:00
Akita Noek
c77620f1ae Added support in ImplicitRoleField to handle following reverse m2m maps 2016-02-15 11:49:54 -05:00
Akita Noek
72419f7eb9 Generically handle automatic role rebinding through m2m relations 2016-02-11 16:59:32 -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
Wayne Witzel III
6877a7a566 added Group.parents rebuilding 2016-02-10 15:13:24 -05:00
Akita Noek
fe29486d7b Removed unnecessary save() 2016-02-05 17:01:19 -05:00
Wayne Witzel III
7b3f3675f8 flake8 fixes 2016-02-05 09:18:52 -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
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
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
Chris Church
60224cdbe4 Update Django to 1.8 and DRF to 3.3, add new Django migrations, update serializers/pagination/metadata, update browsable API styling. 2016-02-02 17:48:04 -05:00
John Mitchell
32d1c0e4db fixed copyright date 2015-06-11 16:10:23 -04:00