Difference between revisions of "Extensions:Character Authorization"

From Lorekeeper Wiki
Jump to navigation Jump to search
(Created page with "{{subst:Extension Page}}")
Tag: 2017 source edit
 
Tag: 2017 source edit
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Extensioninfobox|title=the extension's name|desc=A short description|auth=Author(s)|status=status (such as WIP, testing, stable)|github={{Github|user=username|branch=branch}}|LKVer=What Lorekeeper version the ext is built on|migration=yes/no|package=yes/no}}
+
{{Extensioninfobox|title=Character Authorization|desc=Allows users to hide their characters from other users, and to authorize only a select 25 users to view them.|auth=Cylunny|status=testing|github={{Github|user=Cylunny|branch=extension/character-authorization}}|LKVer=2.1.3|migration=yes|package=no}}
<!-- Put a short summary of your extension here! -->
+
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 ==
 
== Installation ==
<!-- Describe installation. Include any requirements (such as packages), necessary commands, etc. -->
+
* pull & deal with merge conflicts
 +
* <code>php artisan migrate</code>
 +
* <code>php artisan optimize</code> x2
 +
* <code>php artisan update-extension-tracker</code>
 
== Configuration ==
 
== Configuration ==
<!-- Is any configuration necessary? Describe it here! -->
+
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.
 +
<code> <a href="#"><img src="{{ url('/images/characters.png') }}" class="img-thumbnail" alt="Thumbnail for {{ $character->fullName }}"/></a> </code>
 
== Usage ==
 
== Usage ==
<!-- Is there anything users should know about using your extension? -->
+
Users can hide their character and add authorized users by editing their character's profile.
 
== Troubleshooting ==
 
== Troubleshooting ==
<!-- Are there known issues or errors that require user action? Who should they contact, and where, for support? -->
+
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
 +
<code>@if($character)</code>
 +
to
 +
<code>@if($character && (!$character->is_hidden || ($character->is_hidden && $character->isAuthorized(Auth::user()))))</code>
 +
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 ==
 
== Images ==
<!-- Do you have any images to show what it looks like in action? -->
+
(not yet sorry :c)
 
== See Also ==
 
== See Also ==
<!-- Any relevant other pages. You may consider linking to related extensions, for instance. -->
+
If this extension helped you, feel free to support me on [https://ko-fi.com/cylunny Kofi]!
 
 

Latest revision as of 01:40, 24 April 2024

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!