title: $:/plugins/tiddlywiki/multiwikiserver/templates/manage-roles \define add-role-actions() <$action-sendmessage $message="tm-server-request" method="POST" url="/admin/roles" headers="Content-Type: application/json" body={{{ [{"name": "$(newRoleName)$", "description": "$(newRoleDescription)$"}jsonify[]] }}} redirectAfterSuccess="/admin/roles"/> <$action-setfield $tiddler="$:/temp/newRoleName" text=""/> <$action-setfield $tiddler="$:/temp/newRoleDescription" text=""/> \end \define edit-role-actions(role-id) <$action-sendmessage $message="tm-server-request" method="PUT" url={{{ [[$:/admin/roles/]addsuffix] }}} headers="Content-Type: application/json" body={{{ [{"name": "$(newRoleName)$", "description": "$(newRoleDescription)$"}jsonify[]] }}} redirectAfterSuccess="/admin/roles"/> \end \define delete-role-actions(role-id) <$action-sendmessage $message="tm-server-request" method="DELETE" url={{{ [[$:/admin/roles/]addsuffix] }}} redirectAfterSuccess="/admin/roles"/> \end <$tiddler tiddler="$:/plugins/tiddlywiki/multiwikiserver/templates/mws-header"> <$set name="page-title" value="Manage Roles"> <$transclude/>

Existing Roles

<$list filter="[jsonindexes[]]" variable="role-index"> <$let role={{{ [jsonextract] }}}>
<$text text={{{ [jsonget[role_name]] }}}/> <$text text={{{ [jsonget[description]] }}}/>
<$list filter="[jsonget[role_name]lowercase[]!match[admin]]" variable="ignore">
<$let edit-role-id={{{ [jsonget[role_id]] }}}>
<$list filter="[!is[blank]]" variable="ignore">

Edit Role

addprefix[/admin/roles/]] }}} class="add-role-form"> jsonget[role_name]] }}}/> jsonget[description]] }}}/>
<$list filter="[is[blank]]" variable="ignore">

Add New Role