From cf07f756820a7d51584146e32c94894c1257cdb2 Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Wed, 18 Feb 2015 10:47:30 -0500 Subject: [PATCH] added UI for restricted scopes --- .../webapp/resources/js/locale/en/messages.json | 4 ++-- .../src/main/webapp/resources/js/scope.js | 16 ++++++++-------- .../main/webapp/resources/template/scope.html | 12 ++++++------ 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json b/openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json index d85433d4b..3ed74c083 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json @@ -277,8 +277,8 @@ "default-help": "Newly-created clients get this scope by default?", "description-help": "Human-readable text description", "description-placeholder": "Type a description", - "dynamic": "allow dynamic registration", - "dynamic-help": "Allow dynamically registered clients to request this scope?", + "restricted": "restricted", + "restricted-help": "Restricted scopes are only usable by system administrators and are unavailable to dynamically registered clients and protected resources", "edit": "Edit Scope", "icon": "Icon", "new": "New Scope", diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js b/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js index b00425bfa..47234d7f9 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/scope.js @@ -23,7 +23,7 @@ var SystemScopeModel = Backbone.Model.extend({ icon:null, value:null, defaultScope:false, - allowDynReg:false, + restricted:false, structured:false, structuredParamDescription:null, structuredValue:null @@ -46,18 +46,18 @@ var SystemScopeCollection = Backbone.Collection.extend({ return new SystemScopeCollection(filtered); }, - dynRegScopes: function() { + unrestrictedScopes: function() { filtered = this.filter(function(scope) { - return scope.get("allowDynReg") === true; + return scope.get("restricted") !== true; }); return new SystemScopeCollection(filtered); }, - defaultDynRegScopes: function() { + defaultUnrestrictedScopes: function() { filtered = this.filter(function(scope) { - return scope.get("defaultScope") === true && scope.get("allowDynReg") === true; + return scope.get("defaultScope") === true && scope.get("restricted") !== true; }); - return new SystemScopeCollection(filtered); + return new SystemScopeCollection(filtered); }, getByValue: function(value) { @@ -99,7 +99,7 @@ var SystemScopeView = Backbone.View.extend({ render:function (eventName) { this.$el.html(this.template(this.model.toJSON())); - this.$('.allow-dyn-reg').tooltip({title: $.t('scope.system-scope-table.tooltip-dynamic')}); + this.$('.restricted').tooltip({title: $.t('scope.system-scope-table.tooltip-restricted')}); return this; $(this.el).i18n(); @@ -306,7 +306,7 @@ var SystemScopeFormView = Backbone.View.extend({ description:$('#description textarea').val(), icon:$('#iconDisplay input').val(), defaultScope:$('#defaultScope input').is(':checked'), - allowDynReg:$('#allowDynReg input').is(':checked'), + restricted:$('#restricted input').is(':checked'), structured:$('#isStructured input').is(':checked'), structuredParamDescription:$('#structuredParamDescription input').val() }); diff --git a/openid-connect-server-webapp/src/main/webapp/resources/template/scope.html b/openid-connect-server-webapp/src/main/webapp/resources/template/scope.html index d3fba2ff3..8df4cad33 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/template/scope.html +++ b/openid-connect-server-webapp/src/main/webapp/resources/template/scope.html @@ -47,8 +47,8 @@