mirror of
https://github.com/IT4Change/Ocelot-Social.git
synced 2025-12-13 07:45:56 +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 writeTxResultPromise = session.writeTransaction(async (transaction) => {
|
||||
let postRestrictionCypher = ''
|
||||
if (roleInGroup === 'pending') {
|
||||
postRestrictionCypher = `
|
||||
WITH group, member, membership
|
||||
FOREACH (post IN [(p:Post)-[:IN]->(group) | p] |
|
||||
MERGE (member)-[:CANNOT_SEE]->(post))`
|
||||
} else {
|
||||
if (['usual', 'admin', 'owner'].includes(roleInGroup)) {
|
||||
postRestrictionCypher = `
|
||||
WITH group, member, membership
|
||||
FOREACH (restriction IN [(member)-[r:CANNOT_SEE]->(:Post)-[:IN]->(group) | r] |
|
||||
DELETE restriction)`
|
||||
} else {
|
||||
postRestrictionCypher = `
|
||||
WITH group, member, membership
|
||||
FOREACH (post IN [(p:Post)-[:IN]->(group) | p] |
|
||||
MERGE (member)-[:CANNOT_SEE]->(post))`
|
||||
}
|
||||
|
||||
const joinGroupCypher = `
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user