No internet connection
  1. Home
  2. Support

Access to talkyard directly as non admin for embedded blog comments only

By Rudi Bloes @rudibloesart2020-12-28 11:19:40.599Z

Can someone who's not an admin access the forum and see all comments when logged in? As they can see on the website?
Because I want some parts of the blog to be exclusive to sustain members.
Or could I do such a thing through Talkyard using it's member administration?

  • 5 replies
  1. KajMagnus @KajMagnus2020-12-30 03:14:31.368Z

    I want some parts of the blog to be exclusive to sustain members.

    That means that only some people should have access to some parts of the blog, and therefore only they should have access to the related blog comments?

    could I do such a thing through Talkyard using it's member administration?

    You can choose in which category the blog comments will appear — by adding this data-category=... attribute:

    <div class="talkyard-comments" data-category="extid:some_category"  ...
    

    And then you can restrict access to that category, so it's visible to only some people (by placing them in a user group, removing access for the Everyone group, and granting access to that new group instead).

    However I suspect that there won't be any "Log in" button, if one is logged out, for such access restricted categories.
    Which can be mildly annoying for someone who do have access, but isn't logged in.
    This is a small bug / unimplemented thing.

    Does it seem as if I understand properly what you have in mind / want to do? Then I could create some test cases and see if I run into any problems, fix the "Log in" button annoying thing and then write back to you

    1. Rudi Bloes @rudibloesart2021-01-02 09:41:52.983Z

      Yes, thank you. This is what I am looking for.
      It's an art site so I want to work with different levels of people who can participate. People visiting for the first time will probably not want to comment if they need to make an account right away.
      For other customers I want to create a more exclusive environment. These will be different blog post, so working with a category could do the trick.

    2. Progress
    3. Rudi Bloes @rudibloesart2021-01-02 11:57:03.160Z

      Hi Magnus,
      Tried to add a category but got following error:

      Error 500 Internal Server Error
      Something went wrong: [DwE500EXC]

      org.postgresql.util.PSQLException: ERROR: new row for relation "perms_on_pages3" violates check constraint "permsonpages_c_not_meaningless"
      and so on...

      1. Rudi Bloes @rudibloesart2021-01-02 11:59:42.699Zreplies torudibloesart:

        Detail: Failing row contains (1430, 1005, 10, null, 4, null, null, null, null, null, null, null, null, null, null, null, null, null, null).
        at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2440)
        at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2183)
        at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:308)
        at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:441)
        at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:365)
        at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:150)
        at org.postgresql.jdbc.PgPreparedStatement.executeUpdate(PgPreparedStatement.java:127)
        at com.zaxxer.hikari.pool.ProxyPreparedStatement.executeUpdate(ProxyPreparedStatement.java:61)
        at com.zaxxer.hikari.pool.HikariProxyPreparedStatement.executeUpdate(HikariProxyPreparedStatement.java)
        at com.debiki.dao.rdb.Rdb.execImpl(Rdb.scala:511)
        at com.debiki.dao.rdb.Rdb.update(Rdb.scala:471)
        at com.debiki.dao.rdb.RdbSiteTransaction.runUpdate(RdbSiteTransaction.scala:284)
        at com.debiki.dao.rdb.RdbSiteTransaction.runUpdateExactlyOneRow(RdbSiteTransaction.scala:297)
        at com.debiki.dao.rdb.PermsOnPagesRdbMixin.insertPermsOnPages(PermsOnPagesRdbMixin.scala:73)
        at com.debiki.dao.rdb.PermsOnPagesRdbMixin.insertPermsOnPages$(PermsOnPagesRdbMixin.scala:32)
        at com.debiki.dao.rdb.RdbSiteTransaction.insertPermsOnPages(RdbSiteTransaction.scala:38)
        at debiki.dao.CategoriesDao.$anonfun$addRemovePermsOnCategory$4(CategoriesDao.scala:795)
        at debiki.dao.CategoriesDao.$anonfun$addRemovePermsOnCategory$4$adapted(CategoriesDao.scala:775)
        at scala.collection.Iterator.foreach(Iterator.scala:943)
        at scala.collection.Iterator.foreach$(Iterator.scala:943)
        at scala.collection.AbstractIterator.foreach(Iterator.scala:1431)
        at scala.collection.IterableLike.foreach(IterableLike.scala:74)
        at scala.collection.IterableLike.foreach$(IterableLike.scala:73)
        at scala.collection.AbstractIterable.foreach(Iterable.scala:56)
        at debiki.dao.CategoriesDao.addRemovePermsOnCategory(CategoriesDao.scala:775)
        at debiki.dao.CategoriesDao.createCategoryImpl(CategoriesDao.scala:705)
        at debiki.dao.CategoriesDao.createCategoryImpl$(CategoriesDao.scala:658)
        at debiki.dao.SiteDao.createCategoryImpl(SiteDao.scala:111)
        at debiki.dao.CategoriesDao.$anonfun$createCategory$1(CategoriesDao.scala:646)
        at debiki.dao.SiteDao.$anonfun$writeTx$2(SiteDao.scala:239)
        at debiki.dao.SiteDao.$anonfun$readWriteTransaction$2(SiteDao.scala:293)
        at com.debiki.core.DbDao2.readWriteSiteTransaction(DbDao2.scala:67)
        at debiki.dao.SiteDao.$anonfun$readWriteTransaction$1(SiteDao.scala:293)
        at debiki.dao.SiteDao$.synchronizeOnSiteId(SiteDao.scala:670)
        at debiki.dao.SiteDao.readWriteTransaction(SiteDao.scala:292)
        at debiki.dao.SiteDao.writeTx(SiteDao.scala:255)
        at debiki.dao.SiteDao.writeTx(SiteDao.scala:229)
        at debiki.dao.CategoriesDao.createCategory(CategoriesDao.scala:645)
        at debiki.dao.CategoriesDao.createCategory$(CategoriesDao.scala:643)
        at debiki.dao.SiteDao.createCategory(SiteDao.scala:111)
        at controllers.ForumController.$anonfun$saveCategory$1(ForumController.scala:201)
        at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
        at ed.server.http.PlainApiActions$$anon$1.runBlockIfAuthOk(PlainApiActions.scala:576)
        at ed.server.http.PlainApiActions$$anon$1.invokeBlockAuthViaCookie(PlainApiActions.scala:387)
        at ed.server.http.PlainApiActions$$anon$1.invokeBlockImpl(PlainApiActions.scala:237)
        at ed.server.http.PlainApiActions$$anon$1.invokeBlock(PlainApiActions.scala:123)
        at ed.server.http.PlainApiActions$$anon$1.invokeBlock(PlainApiActions.scala:96)
        at play.api.mvc.ActionBuilder$$anon$9.apply(Action.scala:379)
        at ed.server.http.PlainApiActions$$anon$1.$anonfun$composeAction$1(PlainApiActions.scala:110)
        at ed.server.http.SafeActions$ExceptionAction$.invokeBlock(SafeActions.scala:117)
        at ed.server.http.SafeActions$ExceptionAction$.invokeBlock(SafeActions.scala:83)
        at play.api.mvc.ActionBuilder$$anon$9.apply(Action.scala:379)
        at play.api.mvc.Action.$anonfun$apply$4(Action.scala:82)
        at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$4(Accumulator.scala:168)
        at scala.util.Try$.apply(Try.scala:213)
        at play.api.libs.streams.StrictAccumulator.$anonfun$mapFuture$3(Accumulator.scala:168)
        at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
        at scala.Function1.$anonfun$andThen$1(Function1.scala:57)
        at play.api.libs.streams.StrictAccumulator.run(Accumulator.scala:200)
        at play.core.server.AkkaHttpServer.$anonfun$runAction$4(AkkaHttpServer.scala:418)
        at akka.http.scaladsl.util.FastFuture$.strictTransform$1(FastFuture.scala:41)
        at akka.http.scaladsl.util.FastFuture$.$anonfun$transformWith$3(FastFuture.scala:51)
        at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64)
        at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:56)
        at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:93)
        at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
        at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85)
        at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:93)
        at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:48)
        at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48)
        at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
        at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
        at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
        at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

        1. KajMagnus @KajMagnus2021-01-02 22:00:16.457Zreplies torudibloesart:

          Thanks! Looks like a bug: Seems as if the user interace tries to save permissions that would actually have no effect (e.g. no permissions granted), causing a database constraint to say No.

          Instead, the user interface shouldn't try to save such "nothing" permissions. I'll have a look