mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2026-02-06 09:55:50 +00:00
change from role eq pending to usual, admin, owner includes role
This commit is contained in:
parent
631f34a2e5
commit
7cb1663be7
@ -287,16 +287,16 @@ export default {
|
|||||||
const session = context.driver.session()
|
const session = context.driver.session()
|
||||||
const writeTxResultPromise = session.writeTransaction(async (transaction) => {
|
const writeTxResultPromise = session.writeTransaction(async (transaction) => {
|
||||||
let postRestrictionCypher = ''
|
let postRestrictionCypher = ''
|
||||||
if (roleInGroup === 'pending') {
|
if (['usual', 'admin', 'owner'].includes(roleInGroup)) {
|
||||||
postRestrictionCypher = `
|
|
||||||
WITH group, member, membership
|
|
||||||
FOREACH (post IN [(p:Post)-[:IN]->(group) | p] |
|
|
||||||
MERGE (member)-[:CANNOT_SEE]->(post))`
|
|
||||||
} else {
|
|
||||||
postRestrictionCypher = `
|
postRestrictionCypher = `
|
||||||
WITH group, member, membership
|
WITH group, member, membership
|
||||||
FOREACH (restriction IN [(member)-[r:CANNOT_SEE]->(:Post)-[:IN]->(group) | r] |
|
FOREACH (restriction IN [(member)-[r:CANNOT_SEE]->(:Post)-[:IN]->(group) | r] |
|
||||||
DELETE restriction)`
|
DELETE restriction)`
|
||||||
|
} else {
|
||||||
|
postRestrictionCypher = `
|
||||||
|
WITH group, member, membership
|
||||||
|
FOREACH (post IN [(p:Post)-[:IN]->(group) | p] |
|
||||||
|
MERGE (member)-[:CANNOT_SEE]->(post))`
|
||||||
}
|
}
|
||||||
|
|
||||||
const joinGroupCypher = `
|
const joinGroupCypher = `
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user