comparison doc/rest.txt @ 7972:425dd9854e34

feat: document the /rest/data/user/roles endpoint
author John Rouillard <rouilj@ieee.org>
date Tue, 21 May 2024 16:38:42 -0400
parents d4aef2b004a1
children ab3506b9e315
comparison
equal deleted inserted replaced
7971:fe0348bbe45b 7972:425dd9854e34
1088 Supports the ``OPTIONS`` method for determining which methods are 1088 Supports the ``OPTIONS`` method for determining which methods are
1089 allowed on a given endpoint. 1089 allowed on a given endpoint.
1090 1090
1091 Does not support PUT, DELETE or PATCH. 1091 Does not support PUT, DELETE or PATCH.
1092 1092
1093 /data/user/roles endpoint
1094 -------------------------
1095
1096 The list of valid roles for a user is not an actual class in the
1097 hyperdb. This endpoint returns a list of all defined roles if the
1098 user has the ``Admin`` role. Otherwise it returns a 403 - not
1099 authorized error. The output from this endpoint looks like::
1100
1101 {
1102 "data": {
1103 "collection": [
1104 {
1105 "id": "user",
1106 "name": "user"
1107 },
1108 {
1109 "id": "admin",
1110 "name": "admin"
1111 },
1112 {
1113 "id": "anonymous",
1114 "name": "anonymous"
1115 }
1116 ]
1117 }
1118 }
1119
1120 to mimic a class collection.
1121
1122 Unlike a real class collection endpoint, ``@total_size`` is not
1123 returned. Also it does not support any query options like: filtering,
1124 `@sort`, `@group`, `@verbose` etc. Note that the ``id`` property is
1125 not numeric.
1126
1127 This endpoint was introduced in release 2.4.0 to support a roles
1128 select/dropdown in the web component classhelper. This lets the web
1129 component helper implement the same function in the classic user class
1130 classhelper.
1131
1093 /data/\ *class*/\ *id* item 1132 /data/\ *class*/\ *id* item
1094 --------------------------- 1133 ---------------------------
1095 1134
1096 When you use the ``GET`` method on an item 1135 When you use the ``GET`` method on an item
1097 (e.g. ``/data/issue/42``), a ``link`` attribute contains the link to 1136 (e.g. ``/data/issue/42``), a ``link`` attribute contains the link to

Roundup Issue Tracker: http://roundup-tracker.org/