Allow to specify accessRestrictions on app install

This commit is contained in:
Johannes Zellner
2016-02-26 11:47:20 +01:00
parent c630de1003
commit 7a34f40611
2 changed files with 50 additions and 10 deletions

View File

@@ -36,10 +36,31 @@
</div>
<div class="form-group" ng-show="appInstall.app.manifest.singleUser">
<label class="control-label" for="accessRestriction">User</label>
<p>This is a single user application.</p>
<select class="form-control" id="accessRestriction" ng-model="appInstall.accessRestriction" ng-options="user as user.username for user in users track by user.id" ng-required="appInstall.app.manifest.singleUser">
</select>
<label class="control-label">User</label>
<select class="form-control" ng-model="appInstall.accessRestrictionSingleUser" ng-options="user as user.username for user in users track by user.id" ng-required="appInstall.app.manifest.singleUser"></select>
</div>
<div class="form-group" ng-hide="appInstall.app.manifest.singleUser">
<label class="control-label">Access control</label>
<div class="radio">
<label>
<input type="radio" ng-model="appInstall.accessRestrictionOption" value="">
Every Cloudron user
</label>
</div>
<div class="radio">
<label>
<input type="radio" ng-model="appInstall.accessRestrictionOption" value="restricted">
Restrict to groups
</label>
</div>
<div class="has-error" ng-show="appInstall.accessRestrictionOption !== '' && !appInstall.isAccessRestrictionValid()">Select at least one group</div>
<div>
<div>
<span ng-repeat="group in groups | ignoreAdminGroup">
<button class="btn btn-default" type="button" ng-disabled="appInstall.accessRestrictionOption === ''" ng-click="appInstall.toggleGroup(group);" ng-class="{ 'btn-primary': (appInstall.accessRestriction.groups && appInstall.accessRestriction.groups.indexOf(group.id) !== -1) }">{{ group.name }}</button>
</span>
</div>
</div>
</div>
<br/>