refactor(858 5-8 ①): 서고 감쌈 걷음 — 부르는 쪽이 한 벌을 바로 부름
- 쓰는 곳: `Labor_Ref.refuse_used` 감쌈 지움 → Router_Layers · Store.delete 가 `Library_Uses.refuse_used` · `MyMachine._uses` · `Material_Own.uses` 지움 → `Library_Uses.machines` · `materials` - 권한: `Library_Delete.can_write` 별칭 · `Library_Same_Router._can_write` 지움 → `Layer_Access.can_write` - 층 폴더: `MyMachine_Router._folder` 감쌈 지움 → `Router_Items._root(…, personal=MINE)`(MyMachine_Look 도) - 화면: Material_Pick `OwnRow` 지움 → 내 재료 Api `MyMaterial` 꼴 - 시험: 797_1 · 840_4 · 821_1 · 733_3 · 735_1 이 감쌈 대신 한 벌을 부름 · 갈아 끼움(monkeypatch)은 `access.can_write` Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -34,9 +34,6 @@ _ADD = re.compile(r"^add:#(\d+)(.*)$")
|
||||
_PATCH = ("덮개", "고름", "자재표시")
|
||||
|
||||
|
||||
can_write = access.can_write # 쓰기 판단 한 벌(858-B) — 이름은 5-8 에서 걷음
|
||||
|
||||
|
||||
def _hits(doc: dict[str, Any], rids: dict[str, str]) -> list[tuple[str, str]]:
|
||||
"""문서 안 지울 참조 줄 — [(줄, 키)]."""
|
||||
out = []
|
||||
@@ -84,7 +81,7 @@ def users(session: dict[str, Any] | None, kind: str, gone: list[str]) -> list[di
|
||||
if not hits:
|
||||
continue
|
||||
at = refs.where(path.parent.parent)
|
||||
ok = can_write(session, at)
|
||||
ok = access.can_write(session, at)
|
||||
name = doc.get("일위대가번") or doc.get("이름") or path.stem
|
||||
if ukind == "labor" and (title := _columns(path.parent.parent, memo).get(path.stem)):
|
||||
name = f"{title} · {name}"
|
||||
@@ -259,7 +256,7 @@ def undo(session: dict[str, Any], folder: Path, kind: str, rec: dict[str, Any])
|
||||
at = (one.get("층"), one.get("주인"))
|
||||
path = refs.folder_of(*at) / str(one.get("종류")) / f"{one.get('이름')}.json"
|
||||
try:
|
||||
if not can_write(session, at) or not path.is_file():
|
||||
if not access.can_write(session, at) or not path.is_file():
|
||||
raise store.StoreError(403, "권한 밖 · 없음")
|
||||
raw = path.read_bytes()
|
||||
if store.version_of(raw) != one.get("뒤판"):
|
||||
|
||||
Reference in New Issue
Block a user