* Stash. Super rough progress * Stash * 'h' how toggles history panel Add documents.restore endpoint * Add tests for documents.restore endpoint * Document restore endpoint * Tiding, RevisionMenu, remove scroll dep * Add history menu item * Paginate loading * Fixed: Error boundary styling Select first revision faster * Diff summary, styling * Add history loading placeholder Fix move modal not opening * Fixes: Refreshing page on specific revision * documentation for document.revision * Better handle versions with no text changes (will no longer be created)
22 lines
391 B
JavaScript
22 lines
391 B
JavaScript
// @flow
|
|
import policy from './policy';
|
|
import { Document, Revision, User } from '../models';
|
|
|
|
const { allow } = policy;
|
|
|
|
allow(User, 'create', Document);
|
|
|
|
allow(
|
|
User,
|
|
['read', 'update', 'delete', 'share'],
|
|
Document,
|
|
(user, document) => user.teamId === document.teamId
|
|
);
|
|
|
|
allow(
|
|
Document,
|
|
'restore',
|
|
Revision,
|
|
(document, revision) => document.id === revision.documentId
|
|
);
|