manage user type

This commit is contained in:
Kyle Spearrin 2017-03-13 23:31:01 -04:00
parent 4a6066bb88
commit 51d81dea9f
4 changed files with 50 additions and 5 deletions

View File

@ -22,6 +22,8 @@
};
}
}
$scope.email = user.Email;
$scope.type = user.Type;
$scope.selectedSubvaults = subvaults;
});
});
@ -76,6 +78,7 @@
}
apiService.organizationUsers.put({ orgId: $state.params.orgId, id: id }, {
type: $scope.type,
subvaults: subvaults
}, function () {
$uibModalInstance.close();

View File

@ -64,6 +64,7 @@
apiService.organizationUsers.invite({ orgId: $state.params.orgId }, {
email: model.email,
type: model.type,
subvaults: subvaults
}, function () {
$uibModalInstance.close();

View File

@ -1,9 +1,30 @@
<div class="modal-header">
<button type="button" class="close" ng-click="close()" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<h4 class="modal-title"><i class="fa fa-user"></i> Edit User</h4>
<h4 class="modal-title"><i class="fa fa-user"></i> Edit User <small>{{email}}</small></h4>
</div>
<form name="form" ng-submit="form.$valid && submit()" api-form="submitPromise">
<div class="modal-body">
<h4>User Type</h4>
<div class="form-group">
<div class="radio">
<label>
<input type="radio" id="user-type" ng-model="type" name="Type" value="3" ng-checked="type === 2">
<strong>User</strong> - A regular user with access to your organization's subvaults.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="type" name="Type" value="1" ng-checked="type === 1">
<strong>Admin</strong> - Admins can manage subvaults and users for your organization.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="type" name="Type" value="0" ng-checked="type === 0">
<strong>Owner</strong> - The highest access user that can manage all aspects of your organization.
</label>
</div>
</div>
<h4>Subvault Access</h4>
<div ng-show="loading && !subvaults.length">
Loading...
@ -26,7 +47,7 @@
</thead>
<tbody>
<tr ng-repeat="subvault in subvaults | orderBy: ['name']">
<td style="width: 40px;" valign="middle">
<td style="valign="middle">
<input type="checkbox"
name="selectedSubvaults[]"
value="{{subvault.id}}"
@ -36,7 +57,7 @@
<td valign="middle">
{{subvault.name}}
</td>
<td style="width: 100px; text-align: center;" valign="middle">
<td style="text-align: center;" valign="middle">
<input type="checkbox"
name="selectedSubvaultsReadonly[]"
value="{{subvault.id}}"

View File

@ -5,8 +5,7 @@
<form name="inviteForm" ng-submit="inviteForm.$valid && submit(model)" api-form="submitPromise">
<div class="modal-body">
<p>
Invite a new user to your organization by entering their bitwarden account email address below. Users must already
be registered with bitwarden before you can invite them to your organization.
Invite a new user to your organization by entering their bitwarden account email address below.
</p>
<div class="callout callout-danger validation-errors" ng-show="inviteForm.$errors">
<h4>Errors have occured</h4>
@ -18,6 +17,27 @@
<label for="email">Email</label>
<input type="email" id="email" name="Email" ng-model="model.email" class="form-control" required api-field />
</div>
<h4>User Type</h4>
<div class="form-group">
<div class="radio">
<label>
<input type="radio" id="user-type" ng-model="model.type" name="Type" value="User" checked>
<strong>User</strong> - A regular user with access to your organization's subvaults.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="model.type" name="Type" value="Admin">
<strong>Admin</strong> - Admins can manage subvaults and users for your organization.
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="model.type" name="Type" value="Owner">
<strong>Owner</strong> - The highest access user that can manage all aspects of your organization.
</label>
</div>
</div>
<h4>Subvault Access</h4>
<div ng-show="loading && !subvaults.length">
Loading...