Commit Graph
100 Commits
Author SHA1 Message Date
Akita Noek 21d3051ec4 Include user edit/start/delete/copy capabilities to summary fields
This patch generically adds a map of capabilities that the current user
has on an object, namely can they start, delete, editor, or copy the
object. The intent is that these flags will be used by the UI to disable
buttons that do those things.

 #2479
2016-08-18 15:14:31 -04:00
Akita Noek 6464f6e3d6 flake8 2016-08-16 15:54:12 -04:00
Akita Noek 91cd32d304 Fixed old test expectations 2016-08-16 15:36:07 -04:00
Akita Noek 9c5c09169e Made it so the credential organization field can't be changed
This makes it so the credential organizaiton field can't be changed
through the API (unless the user is a super user). This brings us into
alignment with the original intent.
2016-08-16 15:32:29 -04:00
Akita Noek fc7d2b6c4e Skip some unit tests
These tests broke because we added some additional checks that utilize
the database within the role assignment code, and because of issue
parsing or forming requets between the unit framework and the django
request code I'd guess (for some reason it looks like the `pk` field
isn't getting parsed out and handed in to the kwargs of a post method..
didn't dig into it though.)
2016-08-16 14:53:53 -04:00
Akita Noek 30451f230b Fixed org auditor visibility of team credentials
And by fix, I mean prevent us from getting into the situation that was
causing the asymetric visiblity by brining us into alignment with the
original intention and spec for how credentials were supposed behave.

 #3081
2016-08-16 14:02:09 -04:00
Akita Noek db87e3cb30 Merge branch 'release_3.0.2' into 3081 2016-08-16 13:52:57 -04:00
Akita Noek 3d218d5fca Revert "Fix to ensure org auditors can see team credentials"
This reverts commit 5dcb0e57d80a3bb0553ca8194890a938257a6e93.

New clarification on what the actual desired behavior of this whole
system means this commit is trash, fixing in a much better way.
2016-08-11 11:00:02 -04:00
Akita Noek f81d6afe83 Fixed team credential list to work with corrected permissions 2016-08-11 10:17:33 -04:00
Akita Noek d181aefddf Fix to ensure org auditors can see team credentials
#3081
2016-08-10 16:58:39 -04:00
Akita Noek e55de3d073 Fixed team credential creation through API 2016-08-10 16:58:12 -04:00
Akita Noek 94052c2b2b Fixed credential migration issue involving null inventory fields in job templates
Don't attempt to derive credential organization information from a job
template when the inventory field is null for that job template

 #3107
2016-07-22 16:44:00 -04:00
Akita Noek 64d653bc61 Equate '' to None for foreign key references when PUTing to a job template
The UI will sometimes send an empty string instead of null, we already
handle this in our serializer and treat it as null, so this change
brings our access system in line with the expectation that those two
things should be equal.

 Possibly related to #3077
2016-07-22 10:11:33 -04:00
Akita Noek 2934cbbbae Allow users to post some ignored read only fields to job templates without elevated permissions
Previously, posting these fields would cause us to check and see if the
user has not only admin access to the job template but use access on
anything used by the job template (because the fields wern't white
listed as being ok to modify without comprehensive use access). It's
convenient for the QA team to be allowed include these fields in PUT's,
and since they're ignored, this patch is fairly benign and shouldn't
alter any behavior.

 #3076
2016-07-22 09:51:00 -04:00
Akita Noek 5bce9ee215 If you have use_role on an inventory, make it so you can use it in scan jobs
#3077
2016-07-21 17:22:11 -04:00
Akita Noek de9ae86ecc Fix migration problems with inventoryless job templates
#3067
2016-07-21 10:35:43 -04:00
Akita Noek 38f03ea32f Allow auditors to see same /api/v1/config information as admins 2016-07-17 08:04:06 -04:00
Akita Noek 41d6d19bcb Added patch tests for updating project organizations 2016-07-14 15:02:00 -04:00
Akita Noek e18d142533 Don't let normal users create orgless projects
#3006
2016-07-14 14:29:34 -04:00
Akita Noek 6da6f48521 Updated tests to reflect credential access after migrations 2016-07-14 11:04:06 -04:00
Akita Noek 353e6100b9 Fix team credential role access in rbac migration 2016-07-14 09:54:41 -04:00
Akita Noek bb14c9003d Orphan handling in _old_access.py 2016-07-14 09:54:06 -04:00
Akita Noek 7b8c2f5b74 Normalized CustomInventoryScriptAccess.can_admin 2016-07-14 09:53:20 -04:00
Akita Noek fd461a9768 Remove redundant check 2016-07-11 15:05:35 -04:00
Akita Noek ec37703ce8 Allow SA's to read all notification templates 2016-07-11 14:44:36 -04:00
Akita Noek 4c67c50373 Allow system auditors to see notification templates and management jobs in the UI 2016-07-11 14:42:01 -04:00
Akita Noek 6de5cceb8f More is_system_auditor checks in views.py 2016-07-11 14:28:26 -04:00
Akita Noek 134b60dbed Switch to explicit checks for system auditor for all applicable get_queryset calls
Solves #2918 and probably a couple other corner cases where orphan
situations could happen
2016-07-11 14:06:40 -04:00
Akita Noek 02732a26df Swap order of save / cancel buttons for add permissions modal
#2893
2016-07-11 11:02:03 -04:00
Akita Noek 7733167693 Updated tests to reflect new expected behavior 2016-07-08 16:29:14 -04:00
Akita Noek a0017eb074 Skip troublesome old job tests
These are actively being worked on by matburt and cmeyers, merging these
skips because the otherwise unrelated test failures are causing
headaches for the UI team.
2016-07-08 12:33:32 -04:00
Akita Noek ee3d4dc42d Allow anyone who can read an inventory to see adhoc commands run on that inventory
This implicitly solves one of the issues with #2804, but is in general a
better behavior in general we believe.
2016-07-08 12:09:39 -04:00
Akita Noek ffdcd1f20d Don't fetch credential for inventory groups when all we need is the name and it exists in the summary fields
This implicitly solves #2803 by simply not doing the get that was
causing the problem.
2016-07-08 11:14:01 -04:00
Akita Noek 521fa13662 More mock fixes for organizations.py tests 2016-07-07 14:41:11 -04:00
Akita Noek 856ad80c21 Mock feature_enabled for organization tests 2016-07-07 13:53:21 -04:00
Akita Noek 55730f8730 Ported old/organizations.py tests 2016-07-07 11:58:38 -04:00
Akita Noek e41614f4e7 flake8 2016-07-07 10:24:04 -04:00
Akita Noek a42986894f Made it so org auditors can see all users if ORG_ADMINS_CAN_SEE_ALL_USERS is true
Addresses #2706
2016-07-07 09:22:36 -04:00
Akita Noek 0e7ed8428d Allow anyone who can read an inventory to see adhoc command run against said inventory 2016-07-06 14:23:42 -04:00
Akita Noek 015085fe15 Added role visibility tests 2016-07-06 13:38:52 -04:00
Akita Noek b4810f6486 Typo 2016-07-06 13:38:43 -04:00
Akita Noek b94902d970 filter_visible_roles performance enhancement 2016-07-06 12:20:52 -04:00
Akita Noek a126736332 Expand role visibility such that you can always see all roles on any objects you can see
Completes #2774
2016-07-05 15:06:25 -04:00
Akita Noek e818daa74f Ensure system auditors/admins can see all roles
Partial fix for #2744
2016-07-05 14:01:46 -04:00
Akita Noek b21c7e1d15 Fix inventory update permission so update_role is enough to update 2016-06-30 14:58:44 -04:00
Akita Noek d79188f865 Cleaned up unit/test_redact.py 2016-06-30 12:16:57 -04:00
Akita Noek 6e022ae183 Broke out URI test helper from test base.py 2016-06-30 12:16:57 -04:00
Akita Noek fa58ca44b1 Ported old/unified_jobs.py 2016-06-30 12:16:57 -04:00
Akita Noek e2c9d26e0d Ported old/views.py 2016-06-30 12:16:57 -04:00
Akita Noek 9742d02ee8 Eliminated redundant http request code in test suite 2016-06-30 12:16:57 -04:00
Akita Noek 172b6b48b4 Ported old redact.py tests 2016-06-30 12:16:57 -04:00
Akita Noek 66f86de3fa Ported old test_licences.py tests 2016-06-30 12:16:57 -04:00
Akita Noek 096a0a262a Ported old/ha.py test 2016-06-30 12:16:57 -04:00
Akita Noek 8ad505c9cc Fixed notification template deleting
#2674
2016-06-28 12:27:13 -04:00
Akita Noek 5043ff45c2 Removed active_roles
The UI isn't using this feature at the moment so we're going to remove
it for 3.0, and probably bring it back in 3.1, potentially in different
ways depending on UI needs then.
2016-06-28 11:02:28 -04:00
Akita Noek 9f43b6e60c Use SubListAPIView for RoleTeamsList 2016-06-28 10:32:36 -04:00
Akita Noek 831c4c2fef Cleaned up some more stale TODO's and FIXME's (or did / fixed the things) 2016-06-27 15:12:37 -04:00
Akita Noek 4bf50b2d6a Dead code removal 2016-06-27 15:12:37 -04:00
Akita Noek bf6767786e Stale comment cleanup 2016-06-27 15:12:37 -04:00
Akita Noek b57739a800 Converted except T,e expressions to except T as e 2016-06-27 15:12:37 -04:00
Akita Noek 7839db0c23 Dead code removal 2016-06-27 15:12:37 -04:00
Akita Noek bf2307946b Locked down roles teams list 2016-06-27 15:12:37 -04:00
Akita Noek d3476ed52a Filter out roles users shouldn't be able to see from parents/children lists 2016-06-27 15:12:37 -04:00
Akita Noek 2b323fc24e Better handle notification template patches for notification_type
This makes it so patches don't require the notification_type to be present
2016-06-27 09:40:39 -04:00
Akita Noek 9494db583d Better handle missing notification_type in patches to notification template
Addresses #2628
2016-06-24 16:50:27 -04:00
Akita Noek 198daf762e Don't update computed fields while mass group deleting until the end
Significantly reduces the time it takes to delete bulk groups, re #2515
2016-06-24 15:28:49 -04:00
Akita Noek ca2b4766a5 Removed some missed things from our Group role removal work
* Removed `groups/n/object_roles`
* Removed `groups/n/access_list`
* `active_roles` from the Group `summary_fields`

 #2631
2016-06-24 14:17:20 -04:00
Akita Noek 291c8126d7 Fixed inventory edit editablity from update_role users
Now you'll need the expected admin_role access to do things like edit
inventory, groups, and hosts.

 Resolves #2561
2016-06-24 11:03:54 -04:00
Akita Noek 20ba96ae84 Description update
With our role removal from inventory groups this description needed some
updating
2016-06-24 09:49:14 -04:00
Akita Noek f6ebf80eba Fixed Group queryset 2016-06-23 11:57:03 -04:00
Akita Noek 392a7dab0d flake8 2016-06-23 11:50:14 -04:00
Akita Noek 7aa31bb51b Updated old test case to allow org admins to create inventory scripts
This was added in https://github.com/ansible/ansible-tower/commit/e9fe45389d7287d1b817d10389367214ab440690
2016-06-23 11:15:56 -04:00
Akita Noek ee8215dc52 Removed InventoryGroup roles 2016-06-23 11:01:22 -04:00
Akita Noek 0bde637308 Hide the "Read" role key from the permissions modal 2016-06-22 09:50:56 -04:00
Akita Noek d329d1807b -debug log 2016-06-21 13:53:36 -04:00
Akita Noek d43cb9fc9f Hide the "Read" role as being something users can select 2016-06-21 13:40:18 -04:00
Akita Noek f580b9f7d8 Hide the team role column and team tab from the add permissions modal on the Teams page 2016-06-21 11:39:01 -04:00
Akita Noek 23ffafd6b9 Fix funky layout on failed project job template warning
Solves #2510

Root cause is the addition of `display: flex` added to `.alert-info` in
https://github.com/ansible/ansible-tower/commit/cefb3713550f3266f02542bc49f8d5e5debbcda4#diff-9ef281f21346102e21d32991c5c756a3R599

however this is apparently needed elsewhere so the easy workaround is to
just wrap any content we don't want flexified in a div.
2016-06-21 10:39:13 -04:00
Akita Noek 665738d355 Hide benign credential 403s from inventory updates
#2415
2016-06-20 16:18:30 -04:00
Akita Noek 175c010296 Attach labels instead of erroring on creation if label already exists
If a label already exists, don't error out when trying to post to the
job_templates/n/labels endpoint, instad just lookup the ID and attach
it. This is primarily to benefit the UI, but in general seems like a
good behavior for this endpoint anyways.

 Fixes #2135
2016-06-10 11:56:19 -04:00
Akita Noek 3becfeaaa8 Fixed permissions dialog not opening on job template page
#2263
2016-06-09 16:01:10 -04:00
Akita Noek dd9351b226 jshint 2016-06-09 12:25:39 -04:00
Akita Noek a2137a54a9 Made HTTP Header field full width
To match our style guidelines
2016-06-09 12:18:05 -04:00
Akita Noek a3b297e582 Display error when trying to delete a job you don't have access to
#2076
2016-06-09 10:30:55 -04:00
Akita Noek 2a7c05eeda Fix stdout height issue on firefox
#2028
2016-06-09 09:56:23 -04:00
Akita Noek a65dfde8dc Nuked obsolete multi-org project help tooltip on projects page
#2237
2016-06-08 15:03:46 -04:00
Akita Noek c1f40f9cbf Better "go to parent state" code 2016-06-08 14:33:18 -04:00
Akita Noek f1d915084a jshint 2016-06-08 13:31:50 -04:00
Akita Noek db9a4b8096 Added CodeMirror for notification http headers field
#1752
2016-06-08 13:18:49 -04:00
Akita Noek 5cb403dffd Made survey text fields min length default to 0 instead of 1 2016-06-07 13:54:21 -04:00
Akita Noek 68cfc71899 Fixed show/hide button being slightly too short on default password input field 2016-06-07 13:30:20 -04:00
Akita Noek abcd2219fc Fixed 'show' button working the first click for the default password survey field 2016-06-07 13:21:21 -04:00
Akita Noek aa24608660 Fixed "always invalid" red indicator around survey default password field 2016-06-07 13:19:00 -04:00
Akita Noek 7f6f3febeb jshint 2016-06-07 11:25:33 -04:00
Akita Noek c601ca7738 jshint 2016-06-07 11:22:52 -04:00
Akita Noek f24818148c Navigate to list view if you delete an object you are editing
This patch covers all the cases I could find of places where you could
delete items that you are currently editing. When this happens, we
should now exit the edit mode and return to the list view for whatever
we were viewing.

 Related to #1742
2016-06-07 10:49:34 -04:00
Akita Noek ae06286a01 Added 'type' to credential serializer owner summary fields 2016-06-06 16:22:37 -04:00
Akita Noek aa6e136859 Fixed stdout viewing on management job pages
#1192
2016-06-06 15:56:42 -04:00
Akita Noek 0067e7006f Fix app crash from our pagination when editing invalid things
Addresses the most important part of #1742 , next patch will be to make
it so we just navigate away from the detail page if we delete the item
we're on.
2016-06-06 15:47:25 -04:00
Akita Noek 7e0122615e Added default values to the required job template survey questions
This is really to fix #1445, the problem being that "" does not pass
float validity, and the show/hide was triggering a check which included
the hidden-but-still-there float fields. So this is an easy work around,
and I think it's better UX as well since these values are required to be
filled in in many cases.

Fix survey maker add button after toggling password visibility
2016-06-06 14:53:25 -04:00