gitoria

ident

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmain0f6d1592Merge branch 'f18b-shell-session' into mainIdentmain/components/access.hl

21.7 KB

  1. // components/access.hl — `/access`: WHO MAY ACT IN WHICH OF YOUR APPS (ident#27; the screens he approved 2026-10-29, mockups 027-01…08).
  2. // The matrix (identity × app), "Give access" in three steps (who → which apps, level, label → the key, shown once), a cell's sheet
  3. // (since, last use, level, rotate, revoke). The account stays signed in as itself: no logging out and in. The server side is lib/access.hl.
  4. //
  5. // The faces' names start with `acc…`: a face is found by its EVENT NAME across all files (hl:web).
  6. parent './main.hl'
  7. import { accountOfSession } from '../lib/accounts.hl'
  8. import { matrix, pickList, cellOf, giveAccess, revokeAccess, setLevel, rotateKey } from '../lib/access.hl'
  9. import { siteName } from '../project.hl'
  10. import { messageLook, noticeLook } from './styles.hl'
  11. session = null
  12. me = accountOfSession(&session)
  13. signedIn = me != null
  14. signedOut = me == null
  15. data = me != null ? matrix(me.id) : { apps = [] rows = [] never = [] hasNever = false }
  16. apps = data.apps
  17. rows = data.rows
  18. never = data.never
  19. hasNever = data.hasNever
  20. noApps = apps.length == 0
  21. hasApps = apps.length > 0
  22. __title = siteName + ' | access'
  23. // WHICH SCREEN: 'overview' | 'who' (step 1) | 'where' (step 2) | 'key' (step 3)
  24. screen = 'overview'
  25. isOverview = true
  26. isWho = false
  27. isWhere = false
  28. isKey = false
  29. pickRows = []
  30. pickId = ''
  31. newMode = false
  32. newName = ''
  33. tickRows = []
  34. allOn = false
  35. level = 'write'
  36. writeCls = 'seg on'
  37. readCls = 'seg'
  38. newCls = 'newone'
  39. doneLabel = 'Done'
  40. label = ''
  41. // THE KEY, shown once (never kept by the server)
  42. keyText = ''
  43. keyWho = ''
  44. keyApps = []
  45. hasKey = false
  46. newKeyNeeded = true
  47. hasKeyText = false
  48. noKeyText = true
  49. doneText = ''
  50. // the cell's sheet
  51. sheetOpen = false
  52. sheet = null
  53. message = ''
  54. notice = ''
  55. View {
  56. accessPage {
  57. if (signedOut) {
  58. h1 { "Access" }
  59. p { id = "signinfirst" "Sign in to ident first: " a { href = "/" "sign in" } "." }
  60. }
  61. if (signedIn) {
  62. if (isOverview) {
  63. section { id = "accesssection"
  64. h1 { "Access" }
  65. p { "Which identity may act in which of your apps." }
  66. if (noApps) { p { id = "noapps" "No apps yet. Register an app first, then give an identity access to it: " a { href = "/apps" "your apps" } "." } }
  67. if (hasApps) {
  68. accessMatrix { table { id = "matrix"
  69. thead { tr { th { } for (a of apps) { th { a.name } } } }
  70. tbody {
  71. for (r of rows) {
  72. tr {
  73. th { a { href = r.href r.label } whoSub { r.sub } }
  74. for (c of r.cells) {
  75. td { button { type = "button" class = c.cls value = c.value title = c.tip 'aria-label' = c.tip
  76. on click(e) { emit accOpenCell(e.target.value) }
  77. c.glyph } }
  78. }
  79. }
  80. }
  81. }
  82. } }
  83. matrixKey { id = "legend" "● agent key works · ◐ you log in there · ○ no access. Tap a cell for since / last use / revoke." }
  84. }
  85. if (hasNever) {
  86. h2 { "Never used" }
  87. ul { id = "neverused"
  88. for (n of never) {
  89. li {
  90. neverMain { neverName { n.text } neverLine { n.line } }
  91. button { type = "button" class = "quiet small" name = "revoke" value = n.value "Revoke" on click(e) { emit accRevokeNever(e.target.value) } }
  92. }
  93. }
  94. }
  95. }
  96. if (hasApps) { button { id = "give" type = "button" class = "primary" "+ Give access" on click(e) { emit accStartGive(e) } } }
  97. }
  98. }
  99. if (isWho) {
  100. section { id = "whosection"
  101. stepLabel { "STEP 1 OF 3" }
  102. h1 { "Who gets access?" }
  103. ul { id = "picklist"
  104. for (p of pickRows) {
  105. li { class = p.cls
  106. button { type = "button" Style.pickCard value = p.id on click(e) { emit accPick(e.currentTarget.value) }
  107. avatarDot { class = p.dot p.initial }
  108. pickMain { pickName { p.label } pickSub { p.sub } }
  109. pickMark { p.mark }
  110. }
  111. }
  112. }
  113. li { class = newCls
  114. button { type = "button" id = "newidentity" Style.pickCard on click(e) { emit accPickNew(e) }
  115. avatarDot { "+" }
  116. pickMain { pickName { "New identity" } pickSub { "just a name, nothing else needed" } }
  117. }
  118. }
  119. }
  120. if (newMode) {
  121. label { "Name"
  122. input { id = "newname" name = "newname" maxlength = "60" autocomplete = "off" placeholder = "e.g. Hermes" value = newName on input(e) { emit accSetNewName(e.target.value) } }
  123. }
  124. }
  125. p { id = "message" Style.pMessage message }
  126. button { id = "next" type = "button" class = "primary" "Next" on click(e) { emit accNext(e) } }
  127. button { id = "cancelgive" type = "button" class = "quiet" "Cancel" on click(e) { emit accCancel(e) } }
  128. }
  129. }
  130. if (isWhere) {
  131. section { id = "wheresection"
  132. stepLabel { "STEP 2 OF 3" }
  133. h1 { "Where can " keyWho " act?" }
  134. ul { id = "ticklist"
  135. li {
  136. label {
  137. input { id = "allapps" type = "checkbox" checked = allOn on change(e) { emit accToggleAll(e.target.checked) } }
  138. tickMain { tickName { "All my apps (" + apps.length + ")" } tickSub { "today’s apps; new apps ask again" } }
  139. }
  140. }
  141. for (t of tickRows) {
  142. li {
  143. label {
  144. input { type = "checkbox" name = "app" value = t.id checked = t.on on change(e) { emit accToggleApp(e.target.value) } }
  145. tickMain { tickName { t.name } }
  146. }
  147. }
  148. }
  149. }
  150. h2 { "Level" }
  151. levelRow {
  152. button { type = "button" id = "levelwrite" class = writeCls "Read + write" on click(e) { emit accLevel('write') } }
  153. button { type = "button" id = "levelread" class = readCls "Read only" on click(e) { emit accLevel('read') } }
  154. }
  155. if (newKeyNeeded) {
  156. h2 { "Key label" }
  157. input { id = "keylabel" name = "keylabel" maxlength = "60" autocomplete = "off" value = label on input(e) { emit accSetLabel(e.target.value) } }
  158. }
  159. if (hasKey) { p { keyWho " already has a key: it works in the new apps too, nothing new to copy." } }
  160. p { "In each app " keyWho " can still only do what its project roles allow." }
  161. p { id = "message" Style.pMessage message }
  162. button { id = "givego" type = "button" class = "primary" "Give access" on click(e) { emit accGive(e) } }
  163. button { id = "backwho" type = "button" class = "quiet" "Back" on click(e) { emit accBackToWho(e) } }
  164. }
  165. }
  166. if (isKey) {
  167. section { id = "keysection"
  168. if (hasKeyText) {
  169. stepLabel { "STEP 3 OF 3 · SHOWN ONCE" }
  170. h1 { keyWho "’s key" }
  171. keyBox { id = "thekey" keyText }
  172. button { id = "copykey" type = "button" class = "primary" "Copy key" on click(e) { emit accCopyKey(e) } }
  173. button { id = "copyenv" type = "button" "Copy as .env line" on click(e) { emit accCopyEnv(e) } }
  174. warnBox { "ident keeps only a hash. Once you leave this screen the key cannot be shown again — rotate to get a new one." }
  175. h2 { "Works in" }
  176. chips { for (n of keyApps) { chip { n } } }
  177. h2 { "The conductor uses it as" }
  178. pre { "Authorization: Bearer idt_…\ngit clone https://x:idt_…@gitoria…" }
  179. }
  180. if (noKeyText) {
  181. h1 { doneText }
  182. }
  183. p { id = "notice" Style.pNotice notice }
  184. button { id = "keydone" type = "button" class = "primary" doneLabel on click(e) { emit accDone(e) } }
  185. }
  186. }
  187. if (sheetOpen) {
  188. cellSheet { id = "cellsheet"
  189. h2 { id = "sheettitle" sheet.who " in " sheet.appName }
  190. if (sheet.hasGrant) {
  191. sheetRow { sheetLabel { "Since" } sheetValue { id = "sheetsince" sheet.since } }
  192. sheetRow { sheetLabel { "Last use" } sheetValue { id = "sheetlast" sheet.last } }
  193. sheetRow { sheetLabel { "Level" } sheetValue { id = "sheetlevel" sheet.level }
  194. button { type = "button" id = "changelevel" class = "quiet small" "change" on click(e) { emit accChangeLevel(e) } } }
  195. button { type = "button" id = "rotate" class = "quiet" "Rotate key" on click(e) { emit accRotate(e) } }
  196. button { type = "button" id = "revoke" class = "quiet danger" "Revoke access to " sheet.appName on click(e) { emit accRevoke(e) } }
  197. }
  198. if (sheet.noGrant) {
  199. if (sheet.login) { p { sheet.who " logs in to " sheet.appName " as a person. No key is involved." } }
  200. if (sheet.noLogin) { p { sheet.who " has no access to " sheet.appName "." } }
  201. button { type = "button" id = "giveone" class = "primary" "Give " sheet.who " access to " sheet.appName on click(e) { emit accGiveOne(e) } }
  202. }
  203. p { id = "sheetmessage" Style.pMessage message }
  204. button { type = "button" id = "closesheet" class = "quiet" "Close" on click(e) { emit accCloseSheet(e) } }
  205. }
  206. }
  207. }
  208. }
  209. }
  210. // the page's own look: nested rules named after its elements; colours only through the theme's tokens
  211. Style {
  212. pMessage = messageLook
  213. pNotice = noticeLook
  214. accessMatrix { display = 'block' overflowX = 'auto'
  215. table { width = '100%' borderCollapse = 'separate' borderSpacing = '0 .4rem'
  216. th { padding = '.3rem .2rem' fontWeight = '400' textAlign = 'center' fontSize = '.875rem' color = 'var(--color-text-muted)' background = 'transparent' }
  217. tbody { th { padding = '.5rem .8rem' textAlign = 'left' fontWeight = '700' background = 'var(--color-surface)' borderRadius = 'var(--radius-large) 0 0 var(--radius-large)' a { color = 'var(--color-text-strong)' } }
  218. td { background = 'var(--color-surface)' lastChild { borderRadius = '0 var(--radius-large) var(--radius-large) 0' }
  219. button { width = '100%' minWidth = 'var(--layout-tap)' minHeight = '3rem' padding = '0' fontSize = '1.1rem' } }
  220. }
  221. td { padding = '0' textAlign = 'center' background = 'var(--color-surface)' }
  222. }
  223. }
  224. // THE STATE OF A CELL is a class the data chooses ('cell key' | 'cell login' | 'cell none'): quoted selectors, nothing else can say it
  225. 'td button.key' { color = 'var(--color-success)' }
  226. 'td button.login' { color = 'var(--color-action)' }
  227. 'td button.none' { color = 'var(--color-text-muted)' }
  228. accessPage { display = 'grid' gap = '1rem' maxWidth = '46rem' margin = '0 auto'
  229. h1 { margin = '0' }
  230. h2 { margin = '.6rem 0 0' }
  231. p { margin = '0' }
  232. section { display = 'grid' gap = '.8rem' position = 'relative' }
  233. ul { listStyle = 'none' margin = '0' padding = '0' display = 'grid' gap = '.5rem'
  234. li { display = 'flex' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' margin = '0' padding = '.4rem .8rem' background = 'var(--color-surface)' borderRadius = 'var(--radius-large)'
  235. button { minHeight = 'var(--layout-tap)' }
  236. }
  237. }
  238. label { display = 'flex' alignItems = 'center' gap = '.8rem' minHeight = 'var(--layout-tap)' width = '100%' margin = '0' }
  239. input { flex = 'none' }
  240. }
  241. // from 60rem the main button sits at the top right, beside the title (the 1280 mockup); on the phone it is the last thing on the page
  242. @media { minWidth = '60rem' accessPage { '#give' { position = 'absolute' top = '0' right = '0' width = 'auto' } } }
  243. // the pick buttons of step 1: the card is the tap area
  244. pickCard { flex = '1 1 auto' display = 'flex' justifyContent = 'flex-start' gap = '.7rem' textAlign = 'left' }
  245. // the chosen identity of step 1 (a class the data chooses) and the dashed "New identity"
  246. 'li.on' { outline = '2px solid var(--color-accent)' outlineOffset = '-2px' }
  247. 'li.newone' { background = 'transparent' outline = '2px dashed var(--color-text-muted)' outlineOffset = '-2px' }
  248. 'li.newone.on' { outline = '2px solid var(--color-accent)' }
  249. // the level buttons: the chosen one is the accent
  250. 'button.seg' { background = 'var(--color-surface)' }
  251. 'button.seg.on' { color = 'var(--color-accent-text)' background = 'var(--color-accent)' }
  252. whoSub { display = 'block' fontSize = '.875rem' fontWeight = '400' color = 'var(--color-text-muted)' }
  253. matrixKey { fontSize = '.875rem' color = 'var(--color-text-muted)' }
  254. stepLabel { fontSize = '.875rem' fontWeight = '700' letterSpacing = '.06em' color = 'var(--color-accent)' }
  255. neverMain { display = 'grid' flex = '1 1 auto' minWidth = '0' }
  256. neverName { fontWeight = '700' color = 'var(--color-text-strong)' }
  257. neverLine { fontSize = '.875rem' color = 'var(--color-text-muted)' }
  258. pickMain { display = 'grid' flex = '1 1 auto' minWidth = '0' textAlign = 'left' }
  259. pickName { fontWeight = '700' color = 'var(--color-text-strong)' }
  260. pickSub { fontSize = '.875rem' fontWeight = '400' color = 'var(--color-text-muted)' }
  261. pickMark { color = 'var(--color-success)' }
  262. avatarDot { display = 'inline-flex' alignItems = 'center' justifyContent = 'center' flex = '0 0 auto' width = '2.25rem' height = '2.25rem' borderRadius = '50%' fontWeight = '700' color = 'var(--color-accent-text)' background = 'var(--color-accent)' }
  263. tickMain { display = 'grid' }
  264. tickName { fontWeight = '600' color = 'var(--color-text-strong)' }
  265. tickSub { fontSize = '.875rem' color = 'var(--color-text-muted)' }
  266. levelRow { display = 'grid' gridTemplateColumns = '1fr 1fr' gap = '.5rem' }
  267. keyBox { display = 'block' padding = '.7rem .8rem' fontFamily = 'ui-monospace, monospace' fontSize = '.875rem' color = 'var(--color-text-strong)' background = 'var(--color-background-sunken)' borderRadius = 'var(--radius-small)' overflowWrap = 'anywhere' userSelect = 'all' }
  268. warnBox { display = 'block' padding = '.7rem .8rem' color = 'var(--color-warning)' background = 'var(--color-surface)' borderRadius = 'var(--radius-small)' }
  269. chips { display = 'flex' flexWrap = 'wrap' gap = '.4rem' }
  270. chip { padding = '.2rem .6rem' fontSize = '.875rem' color = 'var(--color-success)' background = 'var(--color-background-sunken)' borderRadius = 'var(--radius-small)' }
  271. cellSheet { position = 'fixed' left = '0' right = '0' bottom = '0' zIndex = '30' display = 'grid' gap = '.5rem' maxWidth = '34rem' margin = '0 auto' padding = '1rem var(--layout-gutter) 1.2rem' background = 'var(--color-surface)' borderRadius = 'var(--radius-large) var(--radius-large) 0 0' boxShadow = '0 -.5rem 2rem var(--color-background-sunken)' }
  272. sheetRow { display = 'flex' alignItems = 'center' justifyContent = 'space-between' gap = '.5rem' padding = '.5rem .8rem' background = 'var(--color-background-sunken)' borderRadius = 'var(--radius-small)' }
  273. sheetLabel { display = 'block' fontWeight = '700' color = 'var(--color-text-strong)' }
  274. sheetValue { display = 'block' fontSize = '.875rem' color = 'var(--color-text-muted)' }
  275. }
  276. // ---- the screens ------------------------------------------------------------------------------------------------
  277. setScreen = (name) => {
  278. screen = name
  279. isOverview = name == 'overview'
  280. isWho = name == 'who'
  281. isWhere = name == 'where'
  282. isKey = name == 'key'
  283. message = ''
  284. return null
  285. }
  286. setData = (d) => {
  287. data = d
  288. apps = d.apps
  289. rows = d.rows
  290. never = d.never
  291. hasNever = d.hasNever
  292. noApps = d.apps.length == 0
  293. hasApps = d.apps.length > 0
  294. return null
  295. }
  296. pickView = () => {
  297. out = []
  298. for (p of pickRows) { out.push(p) }
  299. return out
  300. }
  301. // the step-1 list with the chosen one marked
  302. markPicks = (list) => {
  303. out = []
  304. for (p of list) {
  305. let chosen = !newMode && '' + p.id == '' + pickId
  306. out.push({ id = p.id label = p.label sub = p.sub initial = p.initial isAgent = p.isAgent dot = p.isAgent ? 'agent' : 'person' hasKey = p.hasKey cls = chosen ? 'on' : '' mark = chosen ? '✓' : '' })
  307. }
  308. return out
  309. }
  310. // step 2's list: each app with its tick
  311. tickView = (ids) => {
  312. out = []
  313. for (a of apps) { out.push({ id = a.id name = a.name on = ids.includes(a.id) }) }
  314. return out
  315. }
  316. tickedIds = () => {
  317. out = []
  318. for (t of tickRows) { if (t.on) { out.push(t.id) } }
  319. return out
  320. }
  321. on accStartGive(e) {
  322. notice = ''
  323. pickId = ''
  324. newMode = false
  325. newCls = 'newone'
  326. newName = ''
  327. r = emit server accPickList()
  328. if (r == null) { message = 'the server did not answer — try again' return null }
  329. pickRaw = r
  330. pickRows = markPicks(r)
  331. setScreen('who')
  332. }
  333. pickRaw = []
  334. on accPick(id) {
  335. newMode = false
  336. newCls = 'newone'
  337. pickId = '' + id
  338. pickRows = markPicks(pickRaw)
  339. message = ''
  340. }
  341. on accPickNew(e) {
  342. newMode = true
  343. newCls = 'newone on'
  344. pickId = ''
  345. pickRows = markPicks(pickRaw)
  346. message = ''
  347. }
  348. on accSetNewName(v) { newName = v }
  349. on accCancel(e) { setScreen('overview') }
  350. // step 1 → 2: who is chosen (or a name typed)
  351. on accNext(e) {
  352. if (newMode) {
  353. if (newName.trim() == '') { message = 'type a name for the new identity' return null }
  354. keyWho = newName.trim()
  355. hasKey = false
  356. newKeyNeeded = true
  357. label = keyWho
  358. } else {
  359. let who = null
  360. for (p of pickRaw) { if ('' + p.id == pickId) { who = p } }
  361. if (who == null) { message = 'pick an identity' return null }
  362. keyWho = who.label
  363. hasKey = who.hasKey
  364. newKeyNeeded = !who.hasKey
  365. label = who.label
  366. }
  367. ids = []
  368. for (a of apps) { ids.push(a.id) }
  369. tickRows = tickView(ids)
  370. allOn = true
  371. level = 'write'
  372. writeCls = 'seg on'
  373. readCls = 'seg'
  374. setScreen('where')
  375. }
  376. on accBackToWho(e) { setScreen('who') }
  377. on accToggleAll(ticked) {
  378. ids = []
  379. if (ticked) { for (a of apps) { ids.push(a.id) } }
  380. tickRows = tickView(ids)
  381. allOn = ticked
  382. }
  383. on accToggleApp(id) {
  384. ids = tickedIds()
  385. next = []
  386. let had = false
  387. for (x of ids) { if ('' + x == '' + id) { had = true } else { next.push(x) } }
  388. if (!had) { next.push('' + id) }
  389. tickRows = tickView(next)
  390. allOn = next.length == apps.length
  391. }
  392. on accLevel(v) {
  393. level = v
  394. writeCls = v == 'write' ? 'seg on' : 'seg'
  395. readCls = v == 'read' ? 'seg on' : 'seg'
  396. }
  397. on accSetLabel(v) { label = v }
  398. // step 2 → 3: give access; the key (when a new one was made) is on the screen and nowhere else
  399. on accGive(e) {
  400. ids = tickedIds()
  401. if (ids.length == 0) { message = 'tick at least one app' return null }
  402. input = { apps = ids level = level label = label }
  403. if (newMode) { input.newName = newName } else { input.identity = pickId }
  404. r = emit server accGiveAccess(input)
  405. if (r == null) { message = 'the server did not answer — try again' return null }
  406. if (r.error != null) { message = r.error return null }
  407. setData(r.data)
  408. showKey(r)
  409. }
  410. showKey = (r) => {
  411. keyWho = r.who
  412. keyApps = r.apps
  413. keyText = r.key == null ? '' : r.key
  414. hasKeyText = r.key != null
  415. noKeyText = r.key == null
  416. doneText = r.key == null ? r.who + ' now has access to ' + r.apps.join(', ') + '.' : ''
  417. doneLabel = r.key == null ? 'Done' : 'I saved it — done'
  418. sheetOpen = false
  419. setScreen('key')
  420. return null
  421. }
  422. on accCopyKey(e) {
  423. window.navigator.clipboard.writeText(keyText)
  424. notice = 'Key copied.'
  425. }
  426. on accCopyEnv(e) {
  427. window.navigator.clipboard.writeText('WORLDAPI_TOKEN=' + keyText)
  428. notice = '.env line copied.'
  429. }
  430. // done: the key is gone from the page
  431. on accDone(e) {
  432. keyText = ''
  433. hasKeyText = false
  434. noKeyText = true
  435. keyWho = ''
  436. keyApps = []
  437. notice = ''
  438. setScreen('overview')
  439. }
  440. // ---- a cell's sheet ---------------------------------------------------------------------------------------------
  441. on accOpenCell(v) {
  442. parts = ('' + v).split(':')
  443. r = emit server accCell(parts[0], parts[1])
  444. if (r == null || r.error != null) { return null }
  445. sheet = r
  446. message = ''
  447. sheetOpen = true
  448. }
  449. on accCloseSheet(e) {
  450. sheetOpen = false
  451. message = ''
  452. }
  453. on accChangeLevel(e) {
  454. next = sheet.levelRaw == 'write' ? 'read' : 'write'
  455. r = emit server accSetLevel(sheet.identity, sheet.app, next)
  456. if (r == null || r.error != null) { message = r == null ? 'the server did not answer — try again' : r.error return null }
  457. setData(r.data)
  458. sheet = r.cell
  459. }
  460. on accRevoke(e) {
  461. if (!confirm('Revoke ' + sheet.who + '’s access to ' + sheet.appName + '? It stops working there within 30 seconds.')) { return null }
  462. r = emit server accRevokeCell(sheet.identity, sheet.app)
  463. if (r == null || r.error != null) { message = r == null ? 'the server did not answer — try again' : r.error return null }
  464. setData(r.data)
  465. sheetOpen = false
  466. }
  467. on accRevokeNever(v) {
  468. parts = ('' + v).split(':')
  469. r = emit server accRevokeCell(parts[0], parts[1])
  470. if (r == null || r.error != null) { return null }
  471. setData(r.data)
  472. }
  473. on accRotate(e) {
  474. if (!confirm('Rotate the key of ' + sheet.who + '? The old key stops working at once, in every app.')) { return null }
  475. r = emit server accRotateKey(sheet.identity)
  476. if (r == null || r.error != null) { message = r == null ? 'the server did not answer — try again' : r.error return null }
  477. showKey(r)
  478. }
  479. // a ○ or ◐ cell: give that identity access to that app (step 2, prefilled)
  480. on accGiveOne(e) {
  481. r = emit server accPickList()
  482. if (r == null) { return null }
  483. pickRaw = r
  484. pickId = sheet.identity
  485. newMode = false
  486. keyWho = sheet.who
  487. hasKey = false
  488. newKeyNeeded = true
  489. for (p of r) { if ('' + p.id == pickId) { hasKey = p.hasKey newKeyNeeded = !p.hasKey label = p.label } }
  490. tickRows = tickView([sheet.app])
  491. allOn = apps.length == 1
  492. sheetOpen = false
  493. setScreen('where')
  494. }
  495. // ---- the faces ----------------------------------------------------------------------------------------------------
  496. on server accPickList(session) {
  497. let me = accountOfSession(&session)
  498. if (me == null) { return [] }
  499. return pickList(me.id)
  500. }
  501. on server accGiveAccess(input, session) {
  502. let me = accountOfSession(&session)
  503. if (me == null) { return { error = 'you are not signed in' } }
  504. r = giveAccess(me.id, input)
  505. if (r.error != null) { return r }
  506. r.data = matrix(me.id)
  507. return r
  508. }
  509. on server accCell(identity, app, session) {
  510. let me = accountOfSession(&session)
  511. if (me == null) { return { error = 'you are not signed in' } }
  512. c = cellOf(me.id, identity, app)
  513. if (c == null) { return { error = 'no such cell' } }
  514. return c
  515. }
  516. on server accSetLevel(identity, app, lv, session) {
  517. let me = accountOfSession(&session)
  518. if (me == null) { return { error = 'you are not signed in' } }
  519. r = setLevel(me.id, identity, app, lv)
  520. if (r.error != null) { return r }
  521. return { data = matrix(me.id) cell = cellOf(me.id, identity, app) }
  522. }
  523. on server accRevokeCell(identity, app, session) {
  524. let me = accountOfSession(&session)
  525. if (me == null) { return { error = 'you are not signed in' } }
  526. r = revokeAccess(me.id, identity, app)
  527. if (r.error != null) { return r }
  528. return { data = matrix(me.id) }
  529. }
  530. on server accRotateKey(identity, session) {
  531. let me = accountOfSession(&session)
  532. if (me == null) { return { error = 'you are not signed in' } }
  533. return rotateKey(me.id, identity)
  534. }

Branches

Latest commits

  • 0f6d1592Merge branch 'f18b-shell-session' into mainIdent
  • 19868218|||PR ident#39 shell reads its session member instead of a cross-file emitmre
  • 5d1b3fedMerge branch 'v61-day61' into mainIdent
  • 83faeb15|||PR ident: vendor Hybriel day61mre
  • b2572b34Merge branch 'v59-day59' into mainIdent
  • 67cf016d|||PR ident: vendor Hybriel day59mre
  • 600c043dMerge branch 'v58-day58' into mainIdent
  • 365f8c80|||PR ident: vendor Hybriel day58mre
  • 585126e5Merge branch 'f16-setf' into mainIdent
  • 953bf03a|||PR ident setF mirror dropped (hybriel#370)mre
  • a1419d9cMerge branch 'f15-navigate' into mainIdent
  • 3b3e451f|||PR ident#36 navigate to the app instead of location.assignmre
  • e36f4516Merge branch 'f14-online' into mainIdent
  • 2c5eac91|||PR ident#38 online state without probe timermre
  • bf1980f2Merge branch 'v56-day56' into mainIdent
  • 62ae0adf|||PR ident: vendor Hybriel day56mre
  • 0d18abc4Merge branch 'f13-avatar' into mainIdent
  • 2a99730a|||PR ident#37 avatar in hlmre
  • fa4ed25bMerge branch 'f11-upsert' into mainIdent
  • 8f3d9bc9|||PR ident#42 keyed upsert and removemre