Fix: Case Type Permission Error
This commit is contained in:
parent
6e37690736
commit
8845ee6a81
@ -30,7 +30,7 @@ def get_db():
|
||||
def save(
|
||||
data: schemas.CaseTypeIn,
|
||||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["case_types"]),
|
||||
user: UserToken = Security(get_user, scopes=["case-types"]),
|
||||
) -> schemas.CaseType:
|
||||
try:
|
||||
item = CaseType(name=data.name)
|
||||
@ -53,7 +53,7 @@ def update(
|
||||
id_: uuid.UUID,
|
||||
data: schemas.CaseTypeIn,
|
||||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["case_types"]),
|
||||
user: UserToken = Security(get_user, scopes=["case-types"]),
|
||||
) -> schemas.CaseType:
|
||||
try:
|
||||
item: CaseType = db.query(CaseType).filter(CaseType.id == id_).first()
|
||||
@ -75,7 +75,7 @@ def update(
|
||||
def delete(
|
||||
id_: uuid.UUID,
|
||||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["case_types"]),
|
||||
user: UserToken = Security(get_user, scopes=["case-types"]),
|
||||
) -> schemas.CaseTypeBlank:
|
||||
try:
|
||||
item: CaseType = db.query(CaseType).filter(CaseType.id == id_).first()
|
||||
@ -96,7 +96,7 @@ def delete(
|
||||
@router.get("", response_model=schemas.CaseTypeBlank)
|
||||
def show_blank(
|
||||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["case_types"]),
|
||||
user: UserToken = Security(get_user, scopes=["case-types"]),
|
||||
) -> schemas.CaseTypeBlank:
|
||||
return case_type_blank()
|
||||
|
||||
@ -110,7 +110,7 @@ def show_list(db: Session = Depends(get_db), user: UserToken = Depends(get_user)
|
||||
def show_id(
|
||||
id_: uuid.UUID,
|
||||
db: Session = Depends(get_db),
|
||||
user: UserToken = Security(get_user, scopes=["case_types"]),
|
||||
user: UserToken = Security(get_user, scopes=["case-types"]),
|
||||
) -> schemas.CaseType:
|
||||
item: CaseType = db.query(CaseType).filter(CaseType.id == id_).first()
|
||||
return case_type_info(item)
|
||||
|
Loading…
Reference in New Issue
Block a user