How privacy works
Privacy in MyDiary operates on two levels:- Visibility setting: A property on each entry that defines the general access level
- Friend sharing: Explicit selection of which friends can view an entry
Privacy settings are applied per entry, not globally. This means you can have some entries completely private and others shared with friends—it’s your choice for each piece of content.
Visibility settings
Every diary entry has a visibility property that you set when creating or editing the entry.Available visibility levels
The visibility field is stored as a string in the database and can be set to:- Private
- Friends
- Public
Private entries are visible only to you, the creator.
- Only you can see the entry in your diary
- Friends cannot view it, even if they’re selected in the sharing list
- Ideal for personal thoughts you don’t want to share
Setting entry visibility
Control who can see each entry when you create or edit it.Choose visibility level
When creating or editing an entry, find the visibility dropdown or radio buttons in the form.
Select your privacy preference
Pick one of the available options:
- Private (only you)
- Friends (selected friends)
- Public (wider audience)
Configure friend sharing (if applicable)
If you chose “Friends” visibility, select which specific friends can view this entry from your friends list.
Changing visibility later
You can update an entry’s visibility at any time:- Edit the entry
- Change the visibility setting
- Update or remove friend selections if needed
- Save your changes
Friend-based sharing
For entries with “Friends” visibility, you control exactly which friends can see the content.How friend sharing works
Select friends
When creating or editing an entry with Friends visibility, you’ll see your friends list with checkboxes or a multi-select field.
Choose specific friends
Select one or more friends who should have access to this entry. You can choose:
- Individual friends
- Multiple friends
- All friends
- Or none (entry stays private even with Friends visibility)
Managing shared friends
When you edit an entry, the friend sharing list is synchronized:
- Adding friends: They immediately gain access to the entry
- Removing friends: They immediately lose access to the entry
- Unfriending: If you remove someone from your friends list entirely, they lose access to all entries shared with them
Friend sharing database structure
Friend sharing is managed through theentry_users pivot table:
- entry_id: The diary entry being shared
- user_id: The friend who has access
- Each row grants one friend access to one entry
How sync works
How sync works
When you update an entry’s shared friends:
- Create operation: Uses
attach()to add selected friends to the entry - Update operation: Uses
sync()to synchronize the list—adds new friends, removes deselected friends - Delete operation: Cascades automatically when an entry is deleted, revoking all sharing
Privacy best practices
Default to private
Default to private
When in doubt, keep entries private. You can always change to a less restrictive setting later, but you can’t unsee content once shared.
Review before sharing
Review before sharing
Before setting an entry to Friends or Public, reread it to ensure you’re comfortable with others viewing the content.
Be selective with friend sharing
Be selective with friend sharing
Just because someone is your friend doesn’t mean they need access to every entry. Share selectively based on content relevance and sensitivity.
Audit your shared entries
Audit your shared entries
Understand public visibility
Understand public visibility
If your MyDiary instance supports public entries, understand exactly who can see them before using this setting. Public often means anyone on the internet.
What friends can see
When you share an entry with friends, they have specific access:Friends can:
- View the complete entry text (body)
- See any attached images
- View creation and update timestamps
- See that you’re the creator
- Like the entry (if enabled)
Friends cannot:
- Edit your entry content
- Delete your entry
- Change visibility settings
- Modify the shared friends list
- Claim ownership of the entry
Only you, as the creator, can modify or delete your entries. Friend access is read-only with optional interaction features like likes.
Privacy and entry lifecycle
Privacy controls apply throughout an entry’s lifecycle:- Creation
- Updates
- Deletion
Set initial visibility and friend sharing when creating the entry. This determines who can see it immediately upon publication.
Ownership and permissions
Privacy is enforced at the ownership level:- You own all entries you create (stored as
creator_id) - Only owners can change visibility settings
- System enforces ownership checks before allowing updates
- Attempting to modify someone else’s entry results in an error
Privacy in the database
Technical implementation details
Technical implementation details
Privacy controls are implemented across multiple database tables and controller methods:Entries table:
visibilitycolumn stores the privacy level as a stringcreator_idforeign key establishes ownership
- Links entries to users who have shared access
entry_idanduser_idcreate the sharing relationship- Cascade deletion removes sharing when entry or user is deleted
EntryController@create(): Sets visibility and attaches selected friends on creationEntryController@update(): Verifies ownership, updates visibility, syncs friend sharing- Authorization checks prevent unauthorized privacy modifications
- Visibility is checked when displaying entries
- Only entries you created or were shared with appear in your views
- Friend relationships must be accepted (status=‘accepted’) for sharing to work
Common privacy scenarios
Sharing with specific friends only
Sharing with specific friends only
Completely private journaling
Completely private journaling
Set all entries to “Private” visibility. They’ll only be visible to you, regardless of friend selections.
Revoking access after sharing
Revoking access after sharing
Edit the entry and either:
- Change visibility to “Private”
- Remove specific friends from the sharing list
- Both changes save immediately
Sharing with all current friends
Sharing with all current friends