44 Commits

Author SHA1 Message Date
dandds
df06d1b62f Use application_role_id on environment_roles.
In the future, an `application_invitation1 will not refer to a `user` until
someone accepts the invitation; they'll only reference an
`application_role`. When a user is invited to an application, the
inviter can specify the environments the invitee should have access to.
For this to be possible, an `environment_role` should reference an
`application_role`, because no `user` entity will be known at that time.

In addition to updating all the models and domain methods necessary for
this change, this commit deletes unused code and tests that were
dependent on `environment_roles` having a `user_id` foreign key.
2019-05-31 11:21:20 -04:00
George Drummond
454181665c
Fix deleting application members from the team page 2019-05-28 15:41:31 -04:00
dandds
43ea922218 Simplify environment role updates in app settings.
Use ApplicationRole.id instead of User.id in forms. This eliminates the
need for the function that checks whether a user is in a given
application, because looking up the application role will raise an error
if the user is not.
2019-05-24 13:35:00 -04:00
dandds
a332d1432e Use application_role.id to reference users in team page forms.
Membership in a resource should be decoupled from the users table.
2019-05-23 10:13:57 -04:00
leigh-mil
927d1b7925 Add audit log to app settings page 2019-05-22 13:08:44 -04:00
dandds
815632ed00 Handle setting no access for user environment roles:
- use constant for no access string
- update no access constant
- update language and permissions for rendering remove app member button
2019-05-17 14:00:45 -04:00
dandds
0dc0397702 Update user's environment role on the team page.
- Includes adjustments to the applications.update_team route
- Adds hidden environment ID to the HTML form
2019-05-17 14:00:45 -04:00
montana-mil
1c4725840c
Merge pull request #815 from dod-ccpo/add-new-env-app-settings
Add New Environment via app settings
2019-05-15 11:30:29 -04:00
George Drummond
b8ea1349b2
Merge pull request #817 from dod-ccpo/delete-user-from-application
Delete an application member
2019-05-14 15:45:32 -04:00
Montana
f07ea38b9b Functionality for adding an env
- uses two route functions - one for update app, another for add
environment
- uses a second form for the app settings page
- uses the /environments/new url naming convention
2019-05-14 11:51:10 -04:00
George Drummond
27a4ef12c6
Delete an application member 2019-05-14 11:07:08 -04:00
leigh-mil
4206aa8a59 Use member.role_name in template and JS
change name of data from roles to rolesCategory to make less confusing
2019-05-14 11:00:14 -04:00
leigh-mil
546e04555d Update role div height
Move serialization into the route
change member.role to member.role_name in form and route
Return 400 for invalid form submission
2019-05-14 11:00:14 -04:00
leigh-mil
319cc17c1c Start vue component for edit-environment-role 2019-05-14 10:58:22 -04:00
leigh-mil
addf2e97a1 Update form to nest all envs in one form 2019-05-14 10:58:22 -04:00
leigh-mil
060c6834bf Add save button and temp member role toggle to env member form 2019-05-14 10:58:22 -04:00
montana-mil
fb7efc6057
Merge pull request #801 from dod-ccpo/app-team-permissions
Application Team Table Permissions
2019-05-07 16:27:23 -04:00
Montana
644acc68fa Refactor application team routes
- pulling out helper functions for constructing forms
- return 400 for form validation errors
- "Yes" appears green on the read only version
2019-05-07 16:21:17 -04:00
Montana
d5307b440f Make user_id required and add post tests
- raise an exception in ApplicationRoles.get()
- permission_sets is not changed if bad data is sent
2019-05-07 16:21:17 -04:00
George Drummond
d9ed8ed2f1
Merge pull request #806 from dod-ccpo/delete-environment
Delete environments from an application
2019-05-07 10:18:32 -04:00
Montana
526bcb1661 Update tests 2019-05-07 09:31:04 -04:00
dandds
926f89d975 Form for application team member table.
Nested form for each member, with child forms for environment roles and
permissions.
2019-05-06 15:15:03 -04:00
dandds
b0600a34db
Merge pull request #802 from dod-ccpo/accept-application-invite
Accept application invite
2019-05-06 14:30:54 -04:00
George Drummond
037fe09163
Delete environments from an application 2019-05-06 13:51:57 -04:00
dandds
59a02572ea Application users should have access to portfolio landing page.
- Adds override to portfolio landing page access check to see if user
  has access to any applications within the portfolio.
- Route for accepting an application invitation redirects directly to
  portfolio applications route.
- Tests ensure application user only sees apps the user has access to on
  the portfolio landing page.
2019-05-03 17:11:57 -04:00
dandds
a2ebdf78a0 Route for accepting an application invitation.
- Domain method for enabling an application role.
- Updated ApplicationRole model `history` property so that it serializes
  the `status` correctly
2019-05-03 17:11:57 -04:00
George Drummond
430a6493f0
Get error state in edit environment name form working 2019-05-03 14:23:47 -04:00
dandds
ade77e6b91 Route for adding new application member
- domain method for creating a new application member
- ApplicationInvitations domain class
- nested form for adding a new user that holds user data, application
  permission sets, and environment roles
- Invitation service can infer invitation type based on role it's given
- new invitation email templates
2019-04-30 14:41:55 -04:00
leigh-mil
41f01f8dec
Merge branch 'master' into edit-env-form-view 2019-04-30 14:34:31 -04:00
montana-mil
0c6f00bf4d
Merge pull request #785 from dod-ccpo/check-user-is-in-app-before-adding-env-role
Check user is in app before adding env role
2019-04-30 14:31:08 -04:00
Montana
94e3dc637a Remove has_member function from application model 2019-04-30 10:27:15 -04:00
leigh-mil
67516b3b55 Combine env_forms and environment_obj 2019-04-30 10:13:55 -04:00
Montana
60b4c50819 Check that all users with changed data are app users before updating env roles 2019-04-29 15:05:59 -04:00
leigh-mil
4c7a8c399c Sort env members by role 2019-04-29 12:32:41 -04:00
leigh-mil
bdb1cc9ce5 Add in users without access to env team info 2019-04-29 12:07:44 -04:00
Montana
6822680bc8 Ensure that a member is an application member before adding the user to an environment 2019-04-29 11:06:37 -04:00
George Drummond
079672c818
Update application environments 2019-04-29 10:46:21 -04:00
leigh-mil
7f4a18a49b Move test checking route access into test_access and rename test checking if route is working 2019-04-25 10:47:39 -04:00
leigh-mil
99a3534d03 Update route to include environment_id 2019-04-25 10:47:39 -04:00
leigh-mil
5e415edaef Update form to handle No access 2019-04-25 10:47:39 -04:00
leigh-mil
9b426bbde4 Add post route for env roles form 2019-04-25 10:47:39 -04:00
leigh-mil
fbd9c9db66 Create form in view route for application settings 2019-04-25 10:47:39 -04:00
dandds
78ba6afba0 rename and rearrange some portfolio route functions 2019-04-22 07:20:08 -04:00
dandds
849c5d4b58 Rearrange and rename application routes.
- move application routes to their own Flask blueprint
- squash application routes to be resource-specific
- reorganize application routes
2019-04-22 07:19:30 -04:00