mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-19 14:09:20 -04:00
servicepermission enum part 5
This commit is contained in:
@@ -38,7 +38,7 @@ class Service(JSONModel, SortByNameMixin):
|
||||
"notes",
|
||||
"prefix_sms",
|
||||
"purchase_order_number",
|
||||
"research_mode",
|
||||
ServicePermission.RESEARCH_MODE,
|
||||
"service_callback_api",
|
||||
"volume_email",
|
||||
"volume_sms",
|
||||
@@ -50,11 +50,11 @@ class Service(JSONModel, SortByNameMixin):
|
||||
)
|
||||
|
||||
ALL_PERMISSIONS = TEMPLATE_TYPES + (
|
||||
"edit_folder_permissions",
|
||||
"email_auth",
|
||||
"inbound_sms",
|
||||
ServicePermission.EDIT_FOLDER_PERMISSIONS,
|
||||
ServicePermission.EMAIL_AUTH,
|
||||
ServicePermission.INBOUND_SMS,
|
||||
"international_sms",
|
||||
"upload_document",
|
||||
ServicePermission.UPLOAD_DOCUMENT,
|
||||
)
|
||||
|
||||
@classmethod
|
||||
@@ -440,7 +440,7 @@ class Service(JSONModel, SortByNameMixin):
|
||||
|
||||
@cached_property
|
||||
def inbound_sms_summary(self):
|
||||
if not self.has_permission("inbound_sms"):
|
||||
if not self.has_permission(ServicePermission.INBOUND_SMS):
|
||||
return None
|
||||
return service_api_client.get_inbound_sms_summary(self.id)
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ from flask import abort, current_app, request, session
|
||||
from flask_login import AnonymousUserMixin, UserMixin, login_user, logout_user
|
||||
from werkzeug.utils import cached_property
|
||||
|
||||
from app.enums import InvitedUserStatus
|
||||
from app.enums import AuthType, InvitedUserStatus
|
||||
from app.event_handlers import (
|
||||
create_add_user_to_service_event,
|
||||
create_set_user_permissions_event,
|
||||
@@ -186,7 +186,7 @@ class User(JSONModel, UserMixin):
|
||||
|
||||
@property
|
||||
def email_auth(self):
|
||||
return self.auth_type == "email_auth"
|
||||
return self.auth_type == AuthType.EMAIL_AUTH
|
||||
|
||||
def reset_failed_login_count(self):
|
||||
user_api_client.reset_failed_login_count(self.id)
|
||||
@@ -546,7 +546,7 @@ class InvitedUser(JSONModel):
|
||||
|
||||
@property
|
||||
def email_auth(self):
|
||||
return self.auth_type == "email_auth"
|
||||
return self.auth_type == AuthType.EMAIL_AUTH
|
||||
|
||||
@classmethod
|
||||
def from_token(cls, token):
|
||||
|
||||
Reference in New Issue
Block a user