Erlaube berechtigten Konten, verknüpfte Originale über die Zugänge des Owners zu lesen.
Deploy Development / deploy (push) Successful in 26s
Test Suite / pytest-backend (push) Successful in 1m51s
Test Suite / smoke-dev (push) Successful in 0s
Test Suite / frontend-build (push) Successful in 9s

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
LarsandCursor committed 2026-10-18 21:47:30 +02:00
1 parent 562c0848b1
commit 75a3949f7c
14 files changed
+815 -93

No files matched your search

+1 -1
View File
@@ -670,7 +670,7 @@ export function CaseDetail() {
/>
</Modal>
<Modal open={modal === "share"} title="Teilen" onClose={() => setModal("")}>
<ShareBox path={`/api/v1/cases/${id}/grants`} grants={record.grants || []} onChange={load} />
<ShareBox path={`/api/v1/cases/${id}/grants`} grants={record.grants || []} onChange={load} allowSources={Boolean(record.is_owner)} />
</Modal>
</>
);
+1 -1
View File
@@ -618,7 +618,7 @@ export function MatterDetail() {
/>
</Modal>
<Modal open={modal === "share"} title="Teilen" onClose={() => setModal("")}>
<ShareBox path={`/api/v1/matters/${id}/grants`} grants={record.grants || []} onChange={load} />
<ShareBox path={`/api/v1/matters/${id}/grants`} grants={record.grants || []} onChange={load} allowSources={Boolean(record.is_owner)} />
</Modal>
<Modal open={modal === "move"} title="Vorgang verschieben" onClose={() => setModal("")}>
<MoveMatter
+16 -3
View File
@@ -320,17 +320,20 @@ function kindLabel(element) {
return kind;
}
export function ShareBox({ path, grants, onChange }) {
export function ShareBox({ path, grants, onChange, allowSources = false }) {
const [email, setEmail] = useState("");
const [canEdit, setCanEdit] = useState(true);
const [canShare, setCanShare] = useState(false);
const [useOwnerSources, setUseOwnerSources] = useState(false);
const [error, setError] = useState("");
async function submit(event) {
event.preventDefault();
setError("");
const body = { email, can_read: true, can_edit: canEdit, can_share: canShare };
if (allowSources) body.use_owner_sources = useOwnerSources;
try {
await api(path, { method: "POST", body: { email, can_read: true, can_edit: canEdit, can_share: canShare } });
await api(path, { method: "POST", body });
setEmail("");
onChange();
} catch (err) {
@@ -354,6 +357,12 @@ export function ShareBox({ path, grants, onChange }) {
</label>
<label className="check"><input type="checkbox" checked={canEdit} onChange={(event) => setCanEdit(event.target.checked)} /> Bearbeiten</label>
<label className="check"><input type="checkbox" checked={canShare} onChange={(event) => setCanShare(event.target.checked)} /> Weitergeben</label>
{allowSources ? (
<label className="check">
<input type="checkbox" checked={useOwnerSources} onChange={(event) => setUseOwnerSources(event.target.checked)} />
Verknüpfte Originale über meine Zugänge zeigen
</label>
) : null}
<button type="submit">Freigeben</button>
<ErrorNote error={error} />
</form>
@@ -362,7 +371,11 @@ export function ShareBox({ path, grants, onChange }) {
{grants.map((grant) => (
<li key={grant.id}>
<span>{grant.display_name} · {grant.email}</span>
<small>{grant.can_edit ? "Bearbeiten" : "Lesen"}{grant.can_share ? ", Weitergeben" : ""}</small>
<small>
{grant.can_edit ? "Bearbeiten" : "Lesen"}
{grant.can_share ? ", Weitergeben" : ""}
{grant.use_owner_sources ? ", Originale über meine Zugänge" : ""}
</small>
<button type="button" className="quiet" onClick={() => revoke(grant.id)}>Entziehen</button>
</li>
))}