core: additional group preferences: prohibit SimpleX links, restrict some features to specific roles (#3964)

* core: additional group preferences: prohibit SimpleX links, restrict some features to specific roles

* add role to group preference items, tests
This commit is contained in:
Evgeny Poberezkin authored and GitHub committed 2024-04-04 20:41:56 +01:00
1 parent 069395c2a0
commit 18efc28d16
20 files changed
+384 -109

No files matched your search

+9
View File
@@ -144,6 +144,15 @@ markdownToList (m1 :|: m2) = markdownToList m1 <> markdownToList m2
parseMarkdown :: Text -> Markdown
parseMarkdown s = fromRight (unmarked s) $ A.parseOnly (markdownP <* A.endOfInput) s
containsFormat :: (Format -> Bool) -> Markdown -> Bool
containsFormat p (Markdown f _) = maybe False p f
containsFormat p (m1 :|: m2) = containsFormat p m1 || containsFormat p m2
isSimplexLink :: Format -> Bool
isSimplexLink = \case
SimplexLink {} -> True;
_ -> False
markdownP :: Parser Markdown
markdownP = mconcat <$> A.many' fragmentP
where