MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / syncRoleForUser

Function syncRoleForUser

deployments/desktop/static/app.js:662–676  ·  view source on GitHub ↗
(userId)

Source from the content-addressed store, hash-verified

660}
661
662async function syncRoleForUser(userId) {
663 const role = state.roles.find((item) => item.user_id === userId);
664 if (!role || role.is_current) {
665 renderRoles(state.roles);
666 return;
667 }
668 const data = await api("/api/roles", {
669 method: "POST",
670 body: JSON.stringify({ action: "switch", role_name: role.name }),
671 });
672 state.roles = data.roles || [];
673 renderRoles(state.roles);
674 await loadUsers(userId);
675 setActiveUser(userId);
676}
677
678async function createRole() {
679 const roleName = $("roleName").value.trim();

Callers 1

bindEventsFunction · 0.85

Calls 4

renderRolesFunction · 0.85
setActiveUserFunction · 0.85
apiFunction · 0.70
loadUsersFunction · 0.70

Tested by

no test coverage detected