MMOframework
Why AI Playground Libraries Documentation Search Agency
FR EN
Index

mmo-scopes

1 symbol · generated 27 Oct 2026

element

mmo-scopes

mmo-scopes.jhs:1

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
CustomShadowElement
The 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

readonlyshows the rights without changing them
kindrole or client: a client's rules are combined with those of its roles.
readonly accessorGet readonly
kind accessorGet the kind of what is edited
entity accessorGet 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

kind

mmo-scopes.jhs

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

readonly

accessormmo-scopes.jhs:99

Get readonly

get readonly() set readonly(value)
Type
boolean

kind

accessormmo-scopes.jhs:112

Get the kind of what is edited

get kind() set kind(value)
Type
string

entity

accessormmo-scopes.jhs:125

Get the role or the client edited

get entity() set entity(value)
Type
?MMO.core.Map

Methods24

t(text, vars)

mmo-scopes.jhs:156
t(text, vars = null)
text
vars = null
returnsstringtext (translated: MMO.i18n.$('...')), its {placeholders} replaced

rich(text)

mmo-scopes.jhs:164
rich(text)
textstringwith code between backquotes
returns!Array<(string | !Node)>text nodes, and code elements for the parts between backquotes

roles()

mmo-scopes.jhs:185
roles()
returns!Array<{uid: ?string, label: string, scopes: !Object<string, boolean>>} the client's roles, in order

describe(uid)

mmo-scopes.jhs:205
describe(uid)
uidstringa rule
returnspath: string, action: ?string, label: string, actionText: ?string} what it names, in words

issueOf(uid)

mmo-scopes.jhs:220
issueOf(uid)
uidstringa rule
returns?stringwhy it has no effect, null if it has one

setRule(uid, value)

mmo-scopes.jhs:239

Set a rule

setRule(uid, value)
uidstring
value?booleannull removes it

updateDatalist(typed)

mmo-scopes.jhs:272

Offer the names the application knows, and the actions of the one typed after its #

updateDatalist(typed)
typed

createSwitch(uid, value)

mmo-scopes.jhs:395

The switch of a rule: not set, allow, deny -- radios, so a change is an input event the form sees

createSwitch(uid, value)
uidstring
value?boolean
returns!HTMLElement

nodes()

mmo-scopes.jhs:411
nodes()
returns!Map<string, {path: string, children: !Array<string>>} every path known or set, by path

createRow(uid, depth, open, actionText)

mmo-scopes.jhs:499

A row of the tree

createRow(uid, depth, open, actionText = null)
uidstringa path, or a path and its action
depthnumber
open?booleannull for a row without children
actionText = null?stringthe text of the action, for an action's row

why(uid, e)

mmo-scopes.jhs:535
why(uid, e)
uid
e
returnsstringwhy, in words, with code between backquotes