feat: Sharing improvements (#1388)
* add migrations * first pass at API * feat: Updated share dialog UI * tests * test * styling tweaks * feat: Show share state on document * fix: Allow publishing share links for draft docs * test: shares.info
This commit is contained in:
@@ -6,8 +6,7 @@ import { AdminRequiredError } from "../errors";
|
||||
const { allow } = policy;
|
||||
|
||||
allow(User, ["read"], Share, (user, share) => user.teamId === share.teamId);
|
||||
allow(User, ["update"], Share, (user, share) => false);
|
||||
allow(User, ["revoke"], Share, (user, share) => {
|
||||
allow(User, ["update", "revoke"], Share, (user, share) => {
|
||||
if (!share || user.teamId !== share.teamId) return false;
|
||||
if (user.id === share.userId) return true;
|
||||
if (user.isAdmin) return true;
|
||||
|
||||
Reference in New Issue
Block a user