26 lines
811 B
Python
26 lines
811 B
Python
from typing import Optional
|
|
|
|
from pydantic import BaseModel
|
|
|
|
from src.system_var import constants
|
|
|
|
|
|
class UserViewModel(BaseModel):
|
|
bio_flg: Optional[int] # bio_sales_inq_auth_flg
|
|
doc_flg: Optional[int] # ult_doctor_inq_auth_flg
|
|
inst_flg: Optional[int] # ult_inst_inq_auth_flg
|
|
# TODO: 削除予定 master_mainte_flg: Optional[int] # AUTH_FLG4
|
|
|
|
def has_ult_doctor_permission(self):
|
|
return self.doc_flg == constants.PERMISSION_ENABLED
|
|
|
|
def has_ult_inst_permission(self):
|
|
return self.inst_flg == constants.PERMISSION_ENABLED
|
|
|
|
def has_bio_permission(self):
|
|
return self.bio_flg == constants.PERMISSION_ENABLED
|
|
|
|
#TODO 削除予定 def has_master_maintenance_permission(self):
|
|
# return self.master_mainte_flg == constants.PERMISSION_ENABLED
|
|
|