@@ -145,14 +145,18 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
145
145
Name : member ,
146
146
DisplayName : "" ,
147
147
Site : Permissions (map [string ][]Action {
148
- // All users can read all other users and know they exist.
149
- ResourceUser .Type : {ActionRead },
150
148
ResourceRoleAssignment .Type : {ActionRead },
151
149
// All users can see the provisioner daemons.
152
150
ResourceProvisionerDaemon .Type : {ActionRead },
153
151
}),
154
- Org : map [string ][]Permission {},
155
- User : allPermsExcept (ResourceWorkspaceLocked ),
152
+ Org : map [string ][]Permission {},
153
+ User : append (allPermsExcept (ResourceWorkspaceLocked , ResourceUser ),
154
+ Permissions (map [string ][]Action {
155
+ // Users cannot do create/update/delete on themselves, but they
156
+ // can read their own details.
157
+ ResourceUser .Type : {ActionRead },
158
+ })... ,
159
+ ),
156
160
}.withCachedRegoValue ()
157
161
158
162
auditorRole := Role {
@@ -163,6 +167,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
163
167
// are not in.
164
168
ResourceTemplate .Type : {ActionRead },
165
169
ResourceAuditLog .Type : {ActionRead },
170
+ ResourceUser .Type : {ActionRead },
166
171
}),
167
172
Org : map [string ][]Permission {},
168
173
User : []Permission {},
@@ -172,6 +177,7 @@ func ReloadBuiltinRoles(opts *RoleOptions) {
172
177
Name : templateAdmin ,
173
178
DisplayName : "Template Admin" ,
174
179
Site : Permissions (map [string ][]Action {
180
+ ResourceUser .Type : {ActionRead },
175
181
ResourceTemplate .Type : {ActionCreate , ActionRead , ActionUpdate , ActionDelete },
176
182
// CRUD all files, even those they did not upload.
177
183
ResourceFile .Type : {ActionCreate , ActionRead , ActionUpdate , ActionDelete },
0 commit comments