Commit cf83c9e
committed
channel: Add selfHasContentAccess, using canSubscribeGroup et al
Fixes #814.
Fixes part of #1786.
The general implementation of group-based permissions (#814)
was added in the commits leading up to this one. This commit
demonstrates implementing a given such permission.
Then we also use the new permission in one place where we already
want to use it, toward #1786. (There's another part of #1786 which
calls for a variation: determining whether the user would be able
to re-subscribe to a channel if they unsubscribe. We'll leave that
for a follow-up.) We'll also be adding a more prominent bit of UI
that wants this permission soon: the list of channels, #188.
To exercise this method on real data, I added some debugging prints
that printed a list of the channels where this returned true, and a
list of the channels where it returned false. I also manually tested
the change for #1786, by visiting an unsubscribed private channel
(via the link in a #-mention), long-pressing the app bar to get the
channel action sheet, and then (as another user, on web) adding and
removing permission for the test user to subscribe themself.1 parent c3be229 commit cf83c9e
2 files changed
+43
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
139 | 140 | | |
140 | 141 | | |
141 | 142 | | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
142 | 181 | | |
143 | 182 | | |
144 | 183 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
445 | 445 | | |
446 | 446 | | |
447 | 447 | | |
448 | | - | |
| 448 | + | |
| 449 | + | |
449 | 450 | | |
450 | | - | |
451 | | - | |
| 451 | + | |
| 452 | + | |
452 | 453 | | |
453 | 454 | | |
454 | 455 | | |
| |||
0 commit comments