graphdb-workbench
Version:
The web application for GraphDB APIs
91 lines (81 loc) • 4.96 kB
HTML
<h1>
{{title}}
<page-info-tooltip></page-info-tooltip>
</h1>
<div id="wb-users" ng-hide="loader">
<div class="mb-1">
<div class="pull-right">
<span id="toggle-security" class="mr-1">
<span class="security-switch-label">{{'security.is' | translate}} <span class="tag {{securityEnabled() ? 'tag-primary' : 'tag-default'}}">{{securityEnabled() ? 'common.on.btn' : 'common.off.btn' | translate}}</span></span>
<span gdb-tooltip="{{'click.to' | translate}} {{securityEnabled() ? 'disable' : 'enable' | translate}} {{'security.label' | translate}}" tooltip-placement="top" ng-click="toggleSecurity()" class="switch">
<input type="checkbox" class="switch" ng-checked="securityEnabled()"/>
<label for="toggle-security"></label>
</span>
</span>
<span ng-show="securityEnabled()" id="toggle-freeaccess">
<span>{{'security.free.access.is' | translate}} <span class="tag {{freeAccessEnabled() ? 'tag-primary' : 'tag-default'}}">{{freeAccessEnabled() ? 'common.on.btn' : 'common.off.btn' | translate}}</span></span>
<span gdb-tooltip="{{'click.to' | translate}} {{freeAccessEnabled() ? 'disable' : 'enable' | translate}} {{'security.free.access.non.admin' | translate}}" tooltip-placement="top" ng-click="toggleFreeAccess()" class="switch">
<input type="checkbox" class="switch" ng-checked="freeAccessEnabled()"/>
<label for="toggle-freeaccess"></label>
</span>
<span ng-show="freeAccessEnabled()">
{{'security.free.access.settings' | translate}}
<a style="padding-left: 0px;" class="btn btn-link" href="#"><em class="icon-settings" gdb-tooltip="{{'security.free.access.config.title' | translate}}" ng-click="editFreeAccess()"></em></a>
</span>
</span>
</div>
<a id="wb-users-userCreateLink" ng-show="!hasExternalAuth()" class="btn btn-primary" href="user/create"><span class="icon-plus"></span> {{'view.create.user.title' | translate}}</a>
</div>
<div ng-show="hasExternalAuth()">
<div> </div>
<div class="alert alert-info no-icon mt-1">
<p>{{'security.using.external.auth.db' | translate}} {{getAuthImplementation()}}.</p>
<p>{{'security.user.settings.modification' | translate}}</p>
<p>{{'security.user.settings.user_role' | translate}}</p>
</div>
</div>
<table id="wb-users-userInUsers" class="table table-striped" aria-describedby="Users table">
<thead>
<tr>
<th id="usernameColumn">{{'security.table.username' | translate}}</th>
<th ng-if="!hasExternalAuth()" id="roleColumn">{{'security.table.role' | translate}}</th>
<th ng-if="!hasExternalAuth()" id="repoRightsColumn">{{'security.repo.rights' | translate}}</th>
<th id="creationDateColumn">{{'security.table.date.created' | translate}}</th>
<th id="actionsColumn">{{'security.table.actions' | translate}}</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in users | orderBy: 'username'">
<td class="username"><span>{{user.username}}</span></td>
<td ng-if="!hasExternalAuth()" class="user-type">{{user.userTypeDescription}}</td>
<td ng-if="!hasExternalAuth()" class="repository-rights">
<div ng-show="user.userType === 'user'" ng-repeat="(repo, rights) in user.repositories track by $index">
<em class="icon-eye text-tertiary" ng-if="rights.read && !rights.write" gdb-tooltip="{{'security.has.read.access' | translate}}"></em>
<em class="icon-edit text-tertiary" ng-if="rights.write" gdb-tooltip="{{'security.has.write.access' | translate}}"></em>
{{repo}}
<em class="fa-kit fa-gdb-graphql text-info" ng-if="rights.graphql" gdb-tooltip="{{rights.write ? 'security.has.mutation_rights' : 'security.no.mutation_rights' | translate}}"></em>
</div>
<div ng-show="user.userType !== 'user'">{{'security.unrestricted' | translate}}</div>
<div>
<span ng-repeat="role in user.customRoles">
<span class="tag tag-primary" >{{ role }}</span>
</span>
</div>
</td>
<td class="date-created"><span>{{user.dateCreated | date: 'yyyy-MM-dd HH:mm:ss'}}</span></td>
<td class="actions-bar">
<span>
<a class="btn btn-link edit-user-btn" href="user/{{encodeURIComponent(user.username)}}">
<em class="icon-edit" gdb-tooltip="{{'security.edit.user.tooltip' | translate}}"></em>
</a>
<a class="btn btn-link secondary delete-user-btn" ng-if="user.username != 'admin'" ng-show="!hasExternalAuth()" href ng-click="removeUser(user.username)">
<em class="icon-trash" gdb-tooltip="{{'security.delete.user.tooltip' | translate}}"></em>
</a>
</span>
</td>
</tr>
</tbody>
</table>
</div>
<div class="ot-loader ot-main-loader" onto-loader size="50" ng-show="loader"></div>