Skip to content

Commit

Permalink
Merge pull request #195 from ba-st/generalize_authorization_assertion
Browse files Browse the repository at this point in the history
Push-up assert:isAuthorizedTo:within: to ResourceRESTfulController
  • Loading branch information
gcotelli committed Jun 17, 2024
2 parents cab16c7 + 434e951 commit d4eef66
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 d4eef66

Please sign in to comment.