viewUser fixes

This commit is contained in:
Bill Burke 2015-07-11 11:01:26 -04:00
parent 919a3f1b91
commit ff25484a34
4 changed files with 8 additions and 10 deletions

View file

@ -8,8 +8,8 @@
<kc-tabs-user></kc-tabs-user> <kc-tabs-user></kc-tabs-user>
<form class="form-horizontal" name="realmForm" novalidate kc-read-only="!access.manageUsers"> <form class="form-horizontal" name="realmForm" novalidate>
<div class="form-group"> <div class="form-group" kc-read-only="!access.manageUsers">
<label class="col-md-2 control-label" class="control-label">Realm Roles</label> <label class="col-md-2 control-label" class="control-label">Realm Roles</label>
<div class="col-md-10"> <div class="col-md-10">
@ -56,7 +56,7 @@
<span>Client Roles</span> <span>Client Roles</span>
<select class="form-control" id="clients" name="clients" ng-change="changeClient()" ng-model="client" ng-options="a.clientId for a in clients" ng-disabled="false"></select> <select class="form-control" id="clients" name="clients" ng-change="changeClient()" ng-model="client" ng-options="a.clientId for a in clients" ng-disabled="false"></select>
</label> </label>
<div class="col-md-10"> <div class="col-md-10" kc-read-only="!access.manageUsers">
<div class="row" data-ng-hide="client"> <div class="row" data-ng-hide="client">
<div class="col-md-4"><span class="text-muted">Select client to view roles for client</span></div> <div class="col-md-4"><span class="text-muted">Select client to view roles for client</span></div>
</div> </div>

View file

@ -5,8 +5,8 @@
<li data-ng-show="create">Add User</li> <li data-ng-show="create">Add User</li>
</ol> </ol>
<h1 data-ng-hide="create">{{user.username|capitalize}}<i style="padding-left: 20px" class="pficon pficon-delete" data-ng-show="!create && access.manageUsers" <h1 data-ng-hide="create">{{user.username|capitalize}}<i style="padding-left: 20px" class="pficon pficon-delete" data-ng-show="!create && access.manageUsers && !changed"
data-ng-hide="changed" data-ng-click="remove()"></i></h1> data-ng-click="remove()"></i></h1>
<h1 data-ng-show="create">Add User</h1> <h1 data-ng-show="create">Add User</h1>
<kc-tabs-user></kc-tabs-user> <kc-tabs-user></kc-tabs-user>

View file

@ -10,7 +10,7 @@
<table class="table table-striped table-bordered"> <table class="table table-striped table-bordered">
<thead> <thead>
<tr> <tr data-ng-show="access.manageUsers">
<th class="kc-table-actions" colspan="6"> <th class="kc-table-actions" colspan="6">
<div class="pull-right" data-ng-show="access.manageUsers"> <div class="pull-right" data-ng-show="access.manageUsers">
<a class="btn btn-primary" ng-click="logoutAll()">Logout All Sessions</a> <a class="btn btn-primary" ng-click="logoutAll()">Logout All Sessions</a>
@ -22,7 +22,7 @@
<th>Started</th> <th>Started</th>
<th>Last Access</th> <th>Last Access</th>
<th>Clients</th> <th>Clients</th>
<th>Action</th> <th data-ng-show="access.manageUsers">Action</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@ -36,7 +36,7 @@
</div> </div>
</ul> </ul>
</td> </td>
<td><a data-ng-show="access.manageUsers" href="" ng-click="logoutSession(session.id)">logout</a> </td> <td data-ng-show="access.manageUsers"><a href="" ng-click="logoutSession(session.id)">logout</a> </td>
</tr> </tr>
</tbody> </tbody>
</table> </table>

View file

@ -330,7 +330,6 @@ public class AuthenticationManagementResource {
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@NoCache @NoCache
public List<RequiredActionProviderRepresentation> getRequiredActions() { public List<RequiredActionProviderRepresentation> getRequiredActions() {
this.auth.requireView();
List<RequiredActionProviderRepresentation> list = new LinkedList<>(); List<RequiredActionProviderRepresentation> list = new LinkedList<>();
for (RequiredActionProviderModel model : realm.getRequiredActionProviders()) { for (RequiredActionProviderModel model : realm.getRequiredActionProviders()) {
RequiredActionProviderRepresentation rep = toRepresentation(model); RequiredActionProviderRepresentation rep = toRepresentation(model);
@ -354,7 +353,6 @@ public class AuthenticationManagementResource {
@Produces(MediaType.APPLICATION_JSON) @Produces(MediaType.APPLICATION_JSON)
@NoCache @NoCache
public RequiredActionProviderRepresentation getRequiredAction(@PathParam("alias") String alias) { public RequiredActionProviderRepresentation getRequiredAction(@PathParam("alias") String alias) {
this.auth.requireView();
RequiredActionProviderModel model = realm.getRequiredActionProviderByAlias(alias); RequiredActionProviderModel model = realm.getRequiredActionProviderByAlias(alias);
if (model == null) { if (model == null) {
throw new NotFoundException("Failed to find required action: " + alias); throw new NotFoundException("Failed to find required action: " + alias);