aboutsummaryrefslogtreecommitdiff
path: root/common/src/user.rs
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/user.rs')
-rw-r--r--common/src/user.rs46
1 files changed, 11 insertions, 35 deletions
diff --git a/common/src/user.rs b/common/src/user.rs
index ef78eca..e0e7a0d 100644
--- a/common/src/user.rs
+++ b/common/src/user.rs
@@ -3,7 +3,6 @@
which is licensed under the GNU Affero General Public License (version 3); see /COPYING.
Copyright (C) 2025 metamuffin <metamuffin.org>
*/
-use crate::{stream::StreamFormat, user};
use bincode::{Decode, Encode};
#[cfg(feature = "rocket")]
use rocket::{FromFormField, UriDisplayQuery};
@@ -99,7 +98,6 @@ pub enum UserPermission {
ManageSelf,
AccessNode(String),
- StreamFormat(StreamFormat),
Transcode,
FederatedContent,
}
@@ -107,33 +105,11 @@ pub enum UserPermission {
impl UserPermission {
pub const ALL_ENUMERABLE: &'static [UserPermission] = {
use UserPermission::*;
- &[
- Admin,
- Transcode,
- ManageSelf,
- FederatedContent,
- StreamFormat(user::StreamFormat::Original),
- ]
+ &[Admin, Transcode, ManageSelf, FederatedContent]
};
pub fn default_value(&self) -> bool {
- use user::StreamFormat::*;
use UserPermission::*;
- matches!(
- self,
- Transcode
- | ManageSelf
- | FederatedContent
- | StreamFormat(
- JhlsIndex
- | Jvtt
- | HlsMaster
- | HlsVariant
- | Matroska
- | Fragment
- | Webvtt
- | Original // TODO remove later
- )
- )
+ matches!(self, Transcode | ManageSelf | FederatedContent)
}
}
@@ -143,15 +119,15 @@ impl Display for UserPermission {
UserPermission::ManageSelf => "manage self (password, display name, etc.)".to_string(),
UserPermission::FederatedContent => "access to federated content".to_string(),
UserPermission::Admin => "administrative rights".to_string(),
- UserPermission::StreamFormat(StreamFormat::Original) => {
- "downloading the original media".to_string()
- }
- UserPermission::StreamFormat(StreamFormat::Matroska) => {
- "downloading a remuxed WebM/Matroska version of the media ".to_string()
- }
- UserPermission::StreamFormat(x) => {
- format!("downloading media via {x:?}")
- }
+ // UserPermission::StreamFormat(StreamFormat::Original) => {
+ // "downloading the original media".to_string()
+ // }
+ // UserPermission::StreamFormat(StreamFormat::Matroska) => {
+ // "downloading a remuxed WebM/Matroska version of the media ".to_string()
+ // }
+ // UserPermission::StreamFormat(x) => {
+ // format!("downloading media via {x:?}")
+ // }
UserPermission::Transcode => "transcoding".to_string(),
// UserPermission::ManageUsers => format!("management of all users"),
// UserPermission::GenerateInvite => format!("inviting new users"),