Documentations › mmo.oauth › js mmo-scopes 1 symbol · generated 27 Oct 2026
The editor of the scopes of a role or a client (mmo.oauth): every right the application knows, as a tree, each with a switch (not set / allow / deny), what it ends up being and why; the rules set, checked (a name or an action nothing checks has no effect, an allow that gives back an action a broader rule denies); a box to test any right, and the help. The rules are those of entity's scopes, changed in place.
<mmo-scopes readonly kind></mmo-scopes> Extends CustomShadowElementThe rules are decided as the server does (`MMO.oauth.Scopes`); the names, the actions and the roles come
from `user/scopes/catalog.json`. document.querySelector('mmo-scopes').entity = role; // role: the MMO.elements.Entity edited
Index readonly shows the rights without changing them kind role or client: a client's rules are combined with those of its roles.readonly accessor Get readonly kind accessor Get the kind of what is edited entity accessor Get the role or the client edited constructor() init() t(text, vars) rich(text) scopesMap() own() roles() describe(uid) issueOf(uid) setRule(uid, value) Set a rule addRule(value) updateAdd() updateDatalist(typed) Offer the names the application knows, and the actions of the one typed after its # refresh() Draw again, once per frame however many changes draw() renderRules() createSwitch(uid, value) The switch of a rule: not set, allow, deny -- radios, so a change is an input event the form sees nodes() reveal(path) Open the tree down to path and show it renderTree() createRow(uid, depth, open, actionText) A row of the tree why(uid, e) renderTest() renderHelp(body)
Attributes2 shows the rights without changing them
readonly
role or client: a client's rules are combined with those of its roles. Taken from the catalog for a saved entity, from the presence of roles otherwise
kind
Properties3 Get readonly
get readonly()
set readonly(value) Type booleanGet the kind of what is edited
get kind()
set kind(value) Type stringGet the role or the client edited
get entity()
set entity(value) Type ?MMO.core.MapMethods24 constructor() init() t(text, vars = null) text vars = null returns stringtext (translated: MMO.i18n.$('...')), its {placeholders} replaced
rich(text) text stringwith code between backquotes returns !Array<(string | !Node)>text nodes, and code elements for the parts between backquotes
scopesMap() returns !MMO.core.Mapthe rules edited
own() returns !Object<string, boolean>the rules set here
roles() returns !Array<{uid: ?string, label: string, scopes: !Object<string, boolean>>} the client's roles, in order
describe(uid) uid stringa rule returns path: string, action: ?string, label: string, actionText: ?string} what it names, in words
issueOf(uid) uid stringa rule returns ?stringwhy it has no effect, null if it has one
Set a rule
setRule(uid, value) uid stringvalue ?booleannull removes it
addRule(value) updateAdd() Offer the names the application knows, and the actions of the one typed after its #
updateDatalist(typed) Draw again, once per frame however many changes
refresh() draw() renderRules() The switch of a rule: not set, allow, deny -- radios, so a change is an input event the form sees
createSwitch(uid, value) uid stringvalue ?booleanreturns !HTMLElement
nodes() returns !Map<string, {path: string, children: !Array<string>>} every path known or set, by path
Open the tree down to path and show it
reveal(path) renderTree() A row of the tree
createRow(uid, depth, open, actionText = null) uid stringa path, or a path and its action depth numberopen ?booleannull for a row without children actionText = null ?stringthe text of the action, for an action's row
why(uid, e) uid e returns stringwhy, in words, with code between backquotes
renderTest() renderHelp(body)