Il repo resta al sito: app in radice, piattaforme nel loro repo
apps/sito passa in radice, apps/platforms si toglie: vive in gitea:Adriano/InsanityLab-platforms, con la storia del repo comune. I piani e le specifiche di Longevity e Campus lasciano docs/ e seguono le piattaforme. README e compose: deploy da /opt/docker/insanitylab/src; al primo deploy .env va spostato da apps/sito/.env alla radice. Refs #20 Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { describe, it, expect } from 'vitest';
|
||||
import { canModifyPost } from '../src/lib/posts';
|
||||
|
||||
describe('canModifyPost', () => {
|
||||
const own = { author_id: 7 };
|
||||
const other = { author_id: 8 };
|
||||
const orphan = { author_id: null };
|
||||
|
||||
it('admin e superuser modificano qualsiasi post', () => {
|
||||
for (const role of ['admin', 'superuser']) {
|
||||
expect(canModifyPost(role, 7, other)).toBe(true);
|
||||
expect(canModifyPost(role, 7, orphan)).toBe(true);
|
||||
}
|
||||
});
|
||||
|
||||
it('user modifica solo i propri', () => {
|
||||
expect(canModifyPost('user', 7, own)).toBe(true);
|
||||
expect(canModifyPost('user', 7, other)).toBe(false);
|
||||
expect(canModifyPost('user', 7, orphan)).toBe(false);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user