Re-structure Permissions; add perm to view users from mutual groups.

This commit is contained in:
Paul Makles
2021-01-26 21:12:23 +00:00
parent 23ec2d61f1
commit f42480886b
17 changed files with 210 additions and 58 deletions

View File

@@ -34,6 +34,8 @@ pub enum Error {
NotFriends,
// ? Channel related errors.
#[snafu(display("This channel does not exist!"))]
UnknownChannel,
#[snafu(display("Cannot edit someone else's message."))]
CannotEditMessage,
#[snafu(display("Cannot remove yourself from a group, use delete channel instead."))]
@@ -81,6 +83,7 @@ impl<'r> Responder<'r, 'static> for Error {
Error::BlockedByOther => Status::Forbidden,
Error::NotFriends => Status::Forbidden,
Error::UnknownChannel => Status::NotFound,
Error::CannotEditMessage => Status::Forbidden,
Error::CannotRemoveYourself => Status::BadRequest,
Error::GroupTooLarge { .. } => Status::Forbidden,