Skip to content

Commit

Permalink
add new user message oauth scope and throttling classes
Browse files Browse the repository at this point in the history
  • Loading branch information
John Tordoff committed Dec 10, 2024
1 parent cd45df2 commit c91534e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/users/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -971,10 +971,10 @@ class UserMessageView(JSONAPIBaseView, generics.CreateAPIView):
UserMessagePermissions,
)

required_read_scopes = [CoreScopes.USERS_READ]
required_write_scopes = [CoreScopes.USERS_WRITE]
required_read_scopes = [CoreScopes.USERS_MESSAGE_READ_EMAIL]
required_write_scopes = [CoreScopes.USERS_MESSAGE_WRITE]
parser_classes = (JSONAPIMultipleRelationshipsParser, JSONAPIMultipleRelationshipsParserForRegularJSON)

throttle_classes = [BurstRateThrottle, SendEmailThrottle]
serializer_class = UserMessageSerializer

view_category = 'users'
Expand Down
2 changes: 2 additions & 0 deletions framework/auth/oauth_scopes.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class CoreScopes:

USERS_READ = 'users_read'
USERS_WRITE = 'users_write'
USERS_MESSAGE_READ_EMAIL = 'users_message_read_email'
USERS_MESSAGE_WRITE_EMAIL = 'users_message_write_email'
USERS_CREATE = 'users_create'

USER_SETTINGS_READ = 'user.settings_read'
Expand Down

0 comments on commit c91534e

Please sign in to comment.