Aggressively simplify channel permissions:
- Only allow setting permissions on the root channel - Only allow public channels to be children of public channels
This commit is contained in:
parent
716221cd38
commit
4b672621d3
18 changed files with 477 additions and 970 deletions
|
@ -17,6 +17,14 @@ impl Model {
|
|||
self.ancestors().last()
|
||||
}
|
||||
|
||||
pub fn is_root(&self) -> bool {
|
||||
self.parent_path.is_empty()
|
||||
}
|
||||
|
||||
pub fn root_id(&self) -> ChannelId {
|
||||
self.ancestors().next().unwrap_or(self.id)
|
||||
}
|
||||
|
||||
pub fn ancestors(&self) -> impl Iterator<Item = ChannelId> + '_ {
|
||||
self.parent_path
|
||||
.trim_end_matches('/')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue