instar 1.3.493 → 1.3.495

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -14837,6 +14837,31 @@ export function createRoutes(ctx) {
14837
14837
  res.status(500).json({ error: e.message });
14838
14838
  }
14839
14839
  });
14840
+ // Registered users that carry a Slack identity — read-only. Feeds the
14841
+ // dashboard Mandates tab's grant form so the operator PICKS a person on a
14842
+ // phone instead of typing a Slack id (Mobile-Complete Operator Actions,
14843
+ // instar#1080). Never exposes channel identifiers beyond the Slack id the
14844
+ // grant itself needs.
14845
+ router.get('/permissions/users', async (_req, res) => {
14846
+ try {
14847
+ const { UserManager } = await import('../users/UserManager.js');
14848
+ const um = new UserManager(ctx.config.stateDir, ctx.config.users);
14849
+ const users = um.listUsers()
14850
+ .map((u) => {
14851
+ const rec = u;
14852
+ return {
14853
+ slackUserId: typeof rec.slackUserId === 'string' ? rec.slackUserId : '',
14854
+ name: rec.name,
14855
+ orgRole: typeof rec.orgRole === 'string' ? rec.orgRole : null,
14856
+ };
14857
+ })
14858
+ .filter((u) => u.slackUserId);
14859
+ res.json({ users });
14860
+ }
14861
+ catch (e) {
14862
+ res.status(500).json({ error: e.message });
14863
+ }
14864
+ });
14840
14865
  router.post('/permissions/registrations/register', async (req, res) => {
14841
14866
  try {
14842
14867
  const { slackUserId, displayName, role } = req.body || {};