[KEYCLOAK-5886] Improvements to Photoz example

- Fixed location of the authz json file in the README
 - Added links to allow easy navigation back to the main page
 - requestEntitlements link now properly display the RPT
This commit is contained in:
Stefan Guilhen 2018-03-15 09:53:58 -03:00
parent ee2d28d589
commit 99d0811412
6 changed files with 22 additions and 8 deletions

View file

@ -73,7 +73,7 @@ open the ``Client Details`` page. Once there, click on the `Authorization` tab.
Click on the ``Select file`` button, which means you want to import a resource server configuration. Now select the file that is located at:
examples/authz/photoz/photoz-restful-api/src/main/resources/photoz-restful-api-authz-service.json
examples/authz/photoz/photoz-restful-api/target/classes/photoz-restful-api-authz-service.json
Now click ``Upload`` and the resource server will be updated accordingly.

View file

@ -82,7 +82,9 @@ module.controller('TokenCtrl', function ($scope, Identity) {
}
$scope.requestEntitlements = function () {
Identity.authorization.entitlement('photoz-restful-api').then(function (rpt) {});
Identity.authorization.entitlement('photoz-restful-api').then(function (rpt) {
$scope.showRpt()
});
}
$scope.Identity = Identity;
@ -99,6 +101,9 @@ module.controller('AlbumCtrl', function ($scope, $http, $routeParams, $location,
$location.path('/');
});
};
$scope.goto = function (path) {
$location.path(path)
}
});
module.controller('ProfileCtrl', function ($scope, $http, $routeParams, $location, Profile) {

View file

@ -1,4 +1,4 @@
<h1>All Albums</h1>
<h2>All Albums</h2>
<table class="table" data-ng-repeat="(key, value) in albums">
<thead>
<tr>
@ -17,3 +17,6 @@
</tr>
</tbody>
</table>
<p>
<a href="#/">Back to main page</a>
</p>

View file

@ -1,7 +1,7 @@
<h1>Create an Album</h1>
<h2>Create an Album</h2>
<form>
Name: <input type="text" id="album.name" ng-model="album.name"/>
<button ng-click="create()" id="save-album">Save</button>
<button ng-click="create()" id="save-album">Save</button> <button ng-click="goto('/')">Cancel</button>
</form>

View file

@ -1 +1,4 @@
<h1>{{album.name}}</h1>
<h2>{{album.name}}</h2>
<div data-ng-show="Identity.isAdmin()"><a href="#/admin/album">Back to albums</a></div>
<div data-ng-show="!Identity.isAdmin()"><a href="#/">Back to main page</a></div>

View file

@ -1,6 +1,9 @@
<h1>My Profile</h1>
<h2>My Profile</h2>
<form>
<p>Name: {{profile.userName}}</p>
<p>Total of albums: {{profile.totalAlbums}}</p>
</form>
<p>
<a href="#/">Back to main page</a>
</p>