added UI for restricted scopes
parent
6885713eed
commit
cf07f75682
|
@ -277,8 +277,8 @@
|
||||||
"default-help": "Newly-created clients get this scope by default?",
|
"default-help": "Newly-created clients get this scope by default?",
|
||||||
"description-help": "Human-readable text description",
|
"description-help": "Human-readable text description",
|
||||||
"description-placeholder": "Type a description",
|
"description-placeholder": "Type a description",
|
||||||
"dynamic": "allow dynamic registration",
|
"restricted": "restricted",
|
||||||
"dynamic-help": "Allow dynamically registered clients to request this scope?",
|
"restricted-help": "Restricted scopes are only usable by system administrators and are unavailable to dynamically registered clients and protected resources",
|
||||||
"edit": "Edit Scope",
|
"edit": "Edit Scope",
|
||||||
"icon": "Icon",
|
"icon": "Icon",
|
||||||
"new": "New Scope",
|
"new": "New Scope",
|
||||||
|
|
|
@ -23,7 +23,7 @@ var SystemScopeModel = Backbone.Model.extend({
|
||||||
icon:null,
|
icon:null,
|
||||||
value:null,
|
value:null,
|
||||||
defaultScope:false,
|
defaultScope:false,
|
||||||
allowDynReg:false,
|
restricted:false,
|
||||||
structured:false,
|
structured:false,
|
||||||
structuredParamDescription:null,
|
structuredParamDescription:null,
|
||||||
structuredValue:null
|
structuredValue:null
|
||||||
|
@ -46,18 +46,18 @@ var SystemScopeCollection = Backbone.Collection.extend({
|
||||||
return new SystemScopeCollection(filtered);
|
return new SystemScopeCollection(filtered);
|
||||||
},
|
},
|
||||||
|
|
||||||
dynRegScopes: function() {
|
unrestrictedScopes: function() {
|
||||||
filtered = this.filter(function(scope) {
|
filtered = this.filter(function(scope) {
|
||||||
return scope.get("allowDynReg") === true;
|
return scope.get("restricted") !== true;
|
||||||
});
|
});
|
||||||
return new SystemScopeCollection(filtered);
|
return new SystemScopeCollection(filtered);
|
||||||
},
|
},
|
||||||
|
|
||||||
defaultDynRegScopes: function() {
|
defaultUnrestrictedScopes: function() {
|
||||||
filtered = this.filter(function(scope) {
|
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) {
|
getByValue: function(value) {
|
||||||
|
@ -99,7 +99,7 @@ var SystemScopeView = Backbone.View.extend({
|
||||||
render:function (eventName) {
|
render:function (eventName) {
|
||||||
this.$el.html(this.template(this.model.toJSON()));
|
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;
|
return this;
|
||||||
$(this.el).i18n();
|
$(this.el).i18n();
|
||||||
|
@ -306,7 +306,7 @@ var SystemScopeFormView = Backbone.View.extend({
|
||||||
description:$('#description textarea').val(),
|
description:$('#description textarea').val(),
|
||||||
icon:$('#iconDisplay input').val(),
|
icon:$('#iconDisplay input').val(),
|
||||||
defaultScope:$('#defaultScope input').is(':checked'),
|
defaultScope:$('#defaultScope input').is(':checked'),
|
||||||
allowDynReg:$('#allowDynReg input').is(':checked'),
|
restricted:$('#restricted input').is(':checked'),
|
||||||
structured:$('#isStructured input').is(':checked'),
|
structured:$('#isStructured input').is(':checked'),
|
||||||
structuredParamDescription:$('#structuredParamDescription input').val()
|
structuredParamDescription:$('#structuredParamDescription input').val()
|
||||||
});
|
});
|
||||||
|
|
|
@ -47,8 +47,8 @@
|
||||||
|
|
||||||
<script type="text/html" id="tmpl-system-scope">
|
<script type="text/html" id="tmpl-system-scope">
|
||||||
<td>
|
<td>
|
||||||
<% if (allowDynReg) { %>
|
<% if (restricted) { %>
|
||||||
<span class="label label-inverse allow-dyn-reg"><i class="icon-globe icon-white"></i></span>
|
<span class="label label-warning restricted"><i class="icon-ban-circle icon-white"></i></span>
|
||||||
<% } %>
|
<% } %>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
|
@ -141,12 +141,12 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="control-group" id="allowDynReg">
|
<div class="control-group" id="restricted">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<label class="checkbox">
|
<label class="checkbox">
|
||||||
<input type="checkbox" <%-allowDynReg ? 'checked' : '' %>> <span data-i18n="scope.system-scope-form.dynamic">allow dynamic registration</span>
|
<input type="checkbox" <%-restricted ? 'checked' : '' %>> <span data-i18n="scope.system-scope-form.restricted">restricted</span>
|
||||||
</label>
|
</label>
|
||||||
<p class="help-block" data-i18n="scope.system-scope-form.dynamic-help">Allow dynamically registered clients to request this scope?</p>
|
<p class="help-block" data-i18n="scope.system-scope-form.restricted-help">Restricted scopes are only usable by system administrators and are unavailable to dynamically registered clients and protected resources</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
@ -209,7 +209,7 @@ _.each(scopes, function(s) {
|
||||||
|
|
||||||
if (ss) {
|
if (ss) {
|
||||||
%>
|
%>
|
||||||
<span class="badge badge-info"
|
<span class="badge badge-<%-ss.get('restricted') ? 'warning' : 'info'%>"
|
||||||
<% if (ss.get('description')) { %>
|
<% if (ss.get('description')) { %>
|
||||||
title="<%- ss.get('description') %>"
|
title="<%- ss.get('description') %>"
|
||||||
<% } %>
|
<% } %>
|
||||||
|
|
Loading…
Reference in New Issue