add: full journals api
add: full notes api
This commit is contained in:
parent
102ea0ee35
commit
42421bd906
11 changed files with 476 additions and 12 deletions
|
@ -2,14 +2,14 @@ use serde::{Serialize, Deserialize};
|
|||
use tetratto_shared::{snow::Snowflake, unix_epoch_timestamp};
|
||||
|
||||
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq, Eq)]
|
||||
pub enum JournalViewPermission {
|
||||
pub enum JournalPrivacyPermission {
|
||||
/// Can be accessed by anyone via link.
|
||||
Public,
|
||||
/// Visible only to the journal owner.
|
||||
Private,
|
||||
}
|
||||
|
||||
impl Default for JournalViewPermission {
|
||||
impl Default for JournalPrivacyPermission {
|
||||
fn default() -> Self {
|
||||
Self::Private
|
||||
}
|
||||
|
@ -21,7 +21,7 @@ pub struct Journal {
|
|||
pub created: usize,
|
||||
pub owner: usize,
|
||||
pub title: String,
|
||||
pub view: JournalViewPermission,
|
||||
pub privacy: JournalPrivacyPermission,
|
||||
}
|
||||
|
||||
impl Journal {
|
||||
|
@ -32,7 +32,7 @@ impl Journal {
|
|||
created: unix_epoch_timestamp(),
|
||||
owner,
|
||||
title,
|
||||
view: JournalViewPermission::default(),
|
||||
privacy: JournalPrivacyPermission::default(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -62,6 +62,12 @@ pub enum AppScope {
|
|||
UserReadRequests,
|
||||
/// Read questions as the user.
|
||||
UserReadQuestions,
|
||||
/// Read the user's stacks.
|
||||
UserReadStacks,
|
||||
/// Read the user's journals.
|
||||
UserReadJournals,
|
||||
/// Read the user's notes.
|
||||
UserReadNotes,
|
||||
/// Create posts as the user.
|
||||
UserCreatePosts,
|
||||
/// Create messages as the user.
|
||||
|
@ -76,6 +82,10 @@ pub enum AppScope {
|
|||
UserCreateCommunities,
|
||||
/// Create stacks on behalf of the user.
|
||||
UserCreateStacks,
|
||||
/// Create journals on behalf of the user.
|
||||
UserCreateJournals,
|
||||
/// Create notes on behalf of the user.
|
||||
UserCreateNotes,
|
||||
/// Delete posts owned by the user.
|
||||
UserDeletePosts,
|
||||
/// Delete messages owned by the user.
|
||||
|
@ -106,6 +116,10 @@ pub enum AppScope {
|
|||
UserManageRequests,
|
||||
/// Manage the user's uploads.
|
||||
UserManageUploads,
|
||||
/// Manage the user's journals.
|
||||
UserManageJournals,
|
||||
/// Manage the user's notes.
|
||||
UserManageNotes,
|
||||
/// Edit posts created by the user.
|
||||
UserEditPosts,
|
||||
/// Edit drafts created by the user.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue