Extensions:Character Authorization

From Lorekeeper Wiki
Jump to navigation Jump to search
Character Authorization
Description Allows users to hide their characters from other users, and to authorize only a select 25 users to view them.
Author(s) Cylunny
Status testing
Github extension/character-authorization
LK Version 2.1.3
Contains a Migration






Allows users to hide their characters from other users, and to authorize only a select 25 users/friends to view them. Staff will always be able to see those characters regardless. Logged out visitors will not see them. There are a couple of special cases:

  • on the masterlist, unauthorized characters will be listed with their slug/number, but the image is replaced with the default lorekeeper characters image. The image or name cannot be clicked, the owner is not listed.
  • on user profiles, the character will not show up at all for unauthorized users.
  • for prompts/submissions, the owner can still select the character, but other users cannot add it to submissions.
  • trying to view the characters page as an unauthorized user will lead to a 404 page.

Installation

  • pull & deal with merge conflicts
  • php artisan migrate
  • php artisan optimize x2
  • php artisan update-extension-tracker

Configuration

If you wish to change the default character image on the masterlist to a custom one, you will need to edit the _masterlist_content.blade file and change the image in line 147 to point to your custom image. <a href="#"><img src="Template:Url('/images/characters.png')" class="img-thumbnail" alt="Thumbnail for {{ $character->fullName }}"/></a>

Usage

Users can hide their character and add authorized users by editing their character's profile.

Troubleshooting

We are never 100% safe from those pesky bugs. If you find something, feel free to contact me- I am cylunny on discord or toyhou.se!

Selected Character Extension

If you use the selected character extension, you will have to edit a line in the _selected_character.blade yourself. Change @if($character) to @if($character && (!$character->is_hidden || ($character->is_hidden && $character->isAuthorized(Auth::user())))) and it should show unauthorized users the 'user has no selected character' info instead.

Other Extensions

You will need to check if other extensions you use also show/display characters some way. If so, you will have to edit the extension code similarly to above to prevent unauthorized viewers from seeing the character.

Images

(not yet sorry :c)

See Also

If this extension helped you, feel free to support me on Kofi!