File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -240,7 +240,10 @@ func New(options *Options) (http.Handler, func()) {
240
240
r .Get ("/" , api .userByName )
241
241
r .Put ("/profile" , api .putUserProfile )
242
242
r .Put ("/suspend" , api .putUserSuspend )
243
- r .Put ("/password" , api .putUserPassword )
243
+ r .Route ("/password" , func (r chi.Router ) {
244
+ r .Use (httpmw .WithRBACObject (rbac .ResourceUserPasswordRole ))
245
+ r .Put ("/password" , authorize (api .putUserPassword , rbac .ActionUpdate ))
246
+ })
244
247
r .Get ("/organizations" , api .organizationsByUser )
245
248
r .Post ("/organizations" , api .postOrganizationsByUser )
246
249
// These roles apply to the site wide permissions.
Original file line number Diff line number Diff line change 24
24
Type : "user_role" ,
25
25
}
26
26
27
+ ResourceUserPasswordRole = Object {
28
+ Type : "user_password" ,
29
+ }
30
+
27
31
// ResourceWildcard represents all resource types
28
32
ResourceWildcard = Object {
29
33
Type : WildcardSymbol ,
You can’t perform that action at this time.
0 commit comments