def METHOD_NAME(user: User, action_type: str, model: str, obj: Any, second_perm=None) -> None:
    if user.has_perm(f"cm.{action_type}_{model}", obj):
        return
    if second_perm is not None and user.has_perm(f"cm.{second_perm}"):
        return
    raise PermissionDenied()