Skip to content

Commit

Permalink
Push-up assert:isAuthorizedTo:within: to ResourceRESTfulController
Browse files Browse the repository at this point in the history
This way it can be used for any controller wanting to check for permissions in the context
  • Loading branch information
gcotelli committed Jun 15, 2024
1 parent cab16c7 commit 434e951
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
7 changes: 0 additions & 7 deletions source/Stargate-Model/OperationsRESTfulController.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,6 @@ OperationsRESTfulController class >> isAbstract [
^ self = OperationsRESTfulController
]

{ #category : 'private' }
OperationsRESTfulController >> assert: httpRequest isAuthorizedTo: permission within: requestContext [

( requestContext includesPermission: permission ) ifFalse: [
httpRequest abort: ZnResponse forbidden ]
]

{ #category : 'private' }
OperationsRESTfulController >> assert: httpRequest isAuthorizedWithin: requestContext [

Expand Down
7 changes: 7 additions & 0 deletions source/Stargate-Model/ResourceRESTfulController.class.st
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ ResourceRESTfulController class >> isAbstract [
^ self = ResourceRESTfulController
]

{ #category : 'asserting' }
ResourceRESTfulController >> assert: httpRequest isAuthorizedTo: permission within: requestContext [

( requestContext includesPermission: permission ) ifFalse: [
httpRequest abort: ZnResponse forbidden ]
]

{ #category : 'private' }
ResourceRESTfulController >> jsonMediaType: aSubType vendoredBy: aVendorName version: aVersion [

Expand Down

0 comments on commit 434e951

Please sign in to comment.