Browse Source

Added support for showing items to unauthenticated users only

master
Patrick Gaskin 6 months ago
parent
commit
c9d1a20cab
Signed by: geek1011 GPG Key ID: A2FD79F68A2AB707
2 changed files with 12 additions and 3 deletions
  1. +3
    -3
      config.go
  2. +9
    -0
      services.sample.conf

+ 3
- 3
config.go View File

@ -348,7 +348,7 @@ func (a AppTag) Filtered(authProvider, authUser string) *AppTag {
filtered.Name = a.Name
filtered.Desc = a.Desc
filtered.User = nil
if a.User.Len() != 0 {
if a.User.Len() != 0 && authUser != "" {
filtered.User = PropList{authProvider + "::" + authUser}
}
filtered.Order = a.Order
@ -446,7 +446,7 @@ func (a AppCategory) Filtered(authProvider, authUser string, filteredTags AppTag
filtered.Name = a.Name
filtered.App = a.App.Filtered(authProvider, authUser, filteredTags)
filtered.User = nil
if a.User.Len() != 0 {
if a.User.Len() != 0 && authUser != "" {
filtered.User = PropList{authProvider + "::" + authUser}
}
filtered.Order = a.Order
@ -558,7 +558,7 @@ func (a App) Filtered(authProvider, authUser string, filteredTags AppTags) *App
filtered.Icon = a.Icon
filtered.Tag = a.Tag.Filtered(filteredTags.Contains)
filtered.User = nil
if a.User.Len() != 0 {
if a.User.Len() != 0 && authUser != "" {
filtered.User = PropList{authProvider + "::" + authUser}
}
filtered.Order = a.Order

+ 9
- 0
services.sample.conf View File

@ -20,6 +20,15 @@ desc = "Which host runs the app."
name = "Service Provider"
desc = "Which service the app is hosted on."
[apps.public]
name = "Public"
users = ["jwt::"] # this will only show for unauthenticated users
[apps.public.app.test]
name = "Example"
domain = "example.com"
link = "https://example.com"
[apps.dev]
name = "Development"

Loading…
Cancel
Save