Akita Noek
83a30f57f5
Fixed JobTemplate migration when inventory is NULL
...
JobTemplate.inventory can be NULL if the inventory was deleted.
2016-05-03 15:56:02 -04:00
Akita Noek
e237648f4c
Merge pull request #1761 from anoek/migration-fixes
...
Migration fixes
2016-05-03 11:32:38 -04:00
Akita Noek
18796ec3ff
Inventory/Group/Host updating is allowed by those with update_role not just admin_role
2016-05-02 16:38:57 -04:00
Akita Noek
e50f20eb69
Check can_update for ProjectAccess.can_start for superusers too
...
can_update is a special model getter that checks to see if the project
is in a valid state it looks like - so it's important to check this for
superusers too. The can_change check does the implicit is_superuser
check for us, so we don't need another expclit check here, just
can_start protection.
2016-05-02 15:56:05 -04:00
Akita Noek
f6f555b185
Prevent organization changes for teams
...
In old_access.py we restricted even super users from doing this. I'm not
sure that it'd actually break anything to allow this, but I'm making the
new access.py behave like old_access.py for good measure until we have a
valid usecase for this.
2016-05-02 15:49:59 -04:00
Akita Noek
826874d61c
CredentialAccess fix to ensure appropriate access to what we're adding a credential to
2016-05-02 15:43:12 -04:00
Akita Noek
c7f2568c10
Fixed up some credential migration issues
2016-05-02 14:44:15 -04:00
Akita Noek
5825737447
Reduce JT read access check to simple read_role check
2016-05-02 11:27:37 -04:00
Akita Noek
83e83a5db3
Actually do job template migrations
...
Seems important
2016-05-02 11:16:15 -04:00
Akita Noek
58e9c4ef87
Fixed JT migration issue
...
Role.__contains__ is not defined here, so we needed to drop in the
implementation instead.
2016-05-02 11:14:31 -04:00
Akita Noek
8a5e22cb4a
Fix old_access user/team reference
2016-05-02 10:14:29 -04:00
Wayne Witzel III
18e42d442e
Merge pull request #1734 from wwitzel3/team-roles-access
...
ensure change access for adding team roles
2016-05-02 10:09:08 -04:00
Akita Noek
29b55fa04d
Moved access control from credential add view to access.py
...
as it should have always been. This messes up being able to post to
api/v1/users/:n/credentials and api/v1/teams/:n/credentials without
specifyign the user/team id in the post body, but looking at the old
code it looks like this might have always been the case, so whatevs..
This fixes a old v new access.py test "failure", and is better anyways..
2016-04-29 17:27:14 -04:00
Akita Noek
1bf4fdbff1
Fixed up the _old_access.py UserAccess queryset
2016-04-29 16:57:51 -04:00
Akita Noek
45a3ccaa50
Merge pull request #1743 from anoek/migration-fixes
...
RBAC Migration fixes
2016-04-29 16:08:03 -04:00
Akita Noek
6427526686
Updated JT migration tests to be more correct
...
This test was passing before because we were erroneously making all
users organization auditors, which gave users read access to all JT's
under the org.
2016-04-29 15:34:54 -04:00
Wayne Witzel III
ef8eb712c6
added tests to assert team roles attach/unattach permissions, removed previous flawed fix
2016-04-28 15:15:26 -04:00
Wayne Witzel III
b6bbd4fa77
ensure change access for adding team roles
2016-04-28 13:43:49 -04:00
Akita Noek
ac1503e55c
Fixed org migrations.. users are 'members' not 'auditors'
2016-04-28 11:50:36 -04:00
Akita Noek
27a7cf0d88
Added an explicit save everything step in the rbac migration
...
This step ensures all of our roles get setup before we start the
migration. It also speeds things up a little as we can wrap everything
with a `with batch_role_ancestor_rebuilding()`. We were pretty much
doing this already, but we had an issue where we didn't catch all job
templates all the time, so this just makes it very explicit and ensures
everything is setup, and does so a little faster.
2016-04-28 10:37:15 -04:00
Akita Noek
951d728472
Fixed and updated activity stream delete operations
...
Switched to using pre_delete instead of post_delete to record activity
stream delete operations so we have access to all of the fields that may
be associated with the field (eg things that may be being deleted with
this object through a cascade delete).
Switched to recording the full dict of the object instead of a diff
(since the diff will always be empty).
2016-04-28 09:49:26 -04:00
Akita Noek
c9501ad556
commented out code cleanup
2016-04-28 09:39:18 -04:00
Akita Noek
af4daec314
More RBAC migration fixes
2016-04-27 16:59:33 -04:00
Wayne Witzel III
7e482cdb36
Merge pull request #1719 from wwitzel3/issue-1699
...
change inventory error warning
2016-04-27 16:44:21 -04:00
Wayne Witzel III
78148da55c
change inventory error warning
2016-04-27 16:31:03 -04:00
Alan Rominger
fcd82c87be
Merge pull request #1705 from AlanCoding/1696_cred_start
...
Change access.py to disallow launching without credential
2016-04-27 16:26:03 -04:00
AlanCoding
d5a3951d52
break up test into 2, isolating context
2016-04-27 15:58:16 -04:00
AlanCoding
4af1e0a9bf
remove additional resource creation in test context
2016-04-27 15:30:51 -04:00
Akita Noek
b670681f6c
Handle JT "create" permissions during migration
2016-04-27 15:28:17 -04:00
Akita Noek
a6f735b4b9
Fixed call to role rebuilder during migrations
2016-04-27 15:27:52 -04:00
AlanCoding
a7311a69c9
runtime test fixtures organized better
2016-04-27 14:24:54 -04:00
Chris Meyers
526e04a00c
Merge pull request #1690 from chrismeyersfsu/fix-labels_disassociate
...
delete label on last disassociate
2016-04-27 13:21:14 -04:00
AlanCoding
271701a968
clean up unused test code
2016-04-27 10:43:03 -04:00
Chris Meyers
1925742da1
delete orphaned labels when jt or j deleted
2016-04-27 09:46:34 -04:00
AlanCoding
5dc17cd72f
New tests for user launching/relaunching with credential/inventory access
2016-04-27 09:03:38 -04:00
Alan Rominger
62acda143f
Merge pull request #1665 from AlanCoding/job_ask_fields
...
Fix display of prompt-ability in job data
2016-04-26 12:21:56 -04:00
Alan Rominger
c1ee5910d1
Merge pull request #1670 from AlanCoding/1642_scan_JT_counts
...
Include scan jobs in organization's job template count
2016-04-26 11:05:25 -04:00
Akita Noek
9921d90316
Fixed duplicate active_roles entries
...
#1692
2016-04-25 20:33:59 -04:00
Chris Meyers
2f18a9f2c1
delete label on last disassociate
2016-04-25 17:20:07 -04:00
Akita Noek
3ffefd30a3
flake8
2016-04-25 14:43:03 -04:00
Akita Noek
40147f28f8
Updated test
2016-04-25 14:29:05 -04:00
Akita Noek
4c15374b05
Optimized (user|team)/:n/roles/
2016-04-25 14:29:05 -04:00
Akita Noek
9df157c971
Added gfk index pair for Role for our access_list queries
2016-04-25 14:29:05 -04:00
Akita Noek
8e4d013342
Optimized /api/v1/hosts/
2016-04-25 14:29:05 -04:00
Akita Noek
6250d9f7e7
Optimized RBAC visible_roles query
2016-04-25 14:29:05 -04:00
Matthew Jones
256487a963
Strip hash marks from slack channels at send time
2016-04-25 09:49:36 -04:00
Chris Meyers
16744e6b78
added missed job template label relationship
2016-04-25 09:46:54 -04:00
Wayne Witzel III
f457e54a23
Merge pull request #1672 from wwitzel3/devel
...
adjusting how we restrict __in based on PR feedback
2016-04-25 09:31:18 -04:00
Chris Meyers
47b3222614
Merge pull request #1659 from chrismeyersfsu/fix-labels_unified
...
labels on unified jobs
2016-04-23 07:44:34 -04:00
Wayne Witzel III
b6b02bee99
adjusting how we restrict __in based on PR feedback
2016-04-22 17:54:44 -04:00