UserPermission and GroupPermission models (#5860)
* fix: rename to group_permissions * fix: delete null collectionId records before setting non null constraint * fix: use scope with collectionId not null * fix: update model with documentId * fix: rename to GroupPermission * fix: rename collection_users to user_permissions * fix: teamPermanentDeleter test * fix: use scope with collectionId not null * fix: update model with documentId * fix: rename to UserPermission * fix: create views upon table rename for zero downtime * fix: remove comments
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
import { CollectionPermission } from "@shared/types";
|
||||
import { CollectionGroup } from "@server/models";
|
||||
import { GroupPermission } from "@server/models";
|
||||
|
||||
type Membership = {
|
||||
id: string;
|
||||
groupId: string;
|
||||
collectionId: string;
|
||||
collectionId?: string | null;
|
||||
permission: CollectionPermission;
|
||||
};
|
||||
|
||||
export default function presentCollectionGroupMembership(
|
||||
membership: CollectionGroup
|
||||
membership: GroupPermission
|
||||
): Membership {
|
||||
return {
|
||||
id: `${membership.groupId}-${membership.collectionId}`,
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
import { CollectionPermission } from "@shared/types";
|
||||
import { CollectionUser } from "@server/models";
|
||||
import { UserPermission } from "@server/models";
|
||||
|
||||
type Membership = {
|
||||
id: string;
|
||||
userId: string;
|
||||
collectionId: string;
|
||||
collectionId?: string | null;
|
||||
permission: CollectionPermission;
|
||||
};
|
||||
|
||||
export default function presentMembership(
|
||||
membership: CollectionUser
|
||||
membership: UserPermission
|
||||
): Membership {
|
||||
return {
|
||||
id: `${membership.userId}-${membership.collectionId}`,
|
||||
|
||||
Reference in New Issue
Block a user