Re: [TW5] How to protect single tiddlers from editing by password

113 views
Skip to first unread message

jonath...@wolke7.net

unread,
Nov 11, 2015, 5:10:01 PM11/11/15
to tiddl...@googlegroups.com

Hi there,

 

I have to reactivate this.

 

I’ve edited the shadow tiddler $:/core/ui/Buttons/edit and added a
reveal widget:

 

<$list filter="[all[current]tag[locked]]">

<!-- THE CORE BUTTON CODE -->

</$list>

 

 

<$list filter="[all[current]!tag[locked]]">

<$reveal type="match" state="$:/_secret" text="my-secret">

<!-- THE CORE BUTTON CODE -->

</$reveal>

</$list>

 

 

First thing is: It’s a bit ugly to have the same code twice, but I didn‘t get to write a syntax like  „If (locked) then {} else {}“

 

Second thing is:

Now I do not get a edit button on missing tiddlers when I open the corresponding link and want to start editing this tiddler. But I do want to be able to edit these Drafts unless they are marked with „locked“ (which cannot be, since they are missing tiddlers …)

 

Any hints again?

 

Von: tiddl...@googlegroups.com [mailto:tiddl...@googlegroups.com] Im Auftrag von Tobias Beer
Gesendet: Dienstag, 29. September 2015 17:48
An: TiddlyWiki <tiddl...@googlegroups.com>
Cc: jonath...@wolke7.net
Betreff: Re: [tw] Re: [TW5] How to protect single tiddlers from editing by password

 

Hi Jonathan,

 

you mean "[all[current]!tag[locked]]" (tag, not tagging), right?


That's right, using the tagging filter for that purpose only works like so...

<$list filter="[all[current]]-[tagging[locked]]">
<!-- only show when not tagged "locked" -->
</$list>


But it's not as efficient as using the tag filer, so... ;-)

How do i prevent my login tiddler of getting saved, so that the wiki
starts with an empty input field in the login tiddler, even if the
password was entered before the last saving?

 

Revisit 3) up above again...

Best wishes,

 

— tb 

--
You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tiddlywiki+...@googlegroups.com.
To post to this group, send email to tiddl...@googlegroups.com.
Visit this group at http://groups.google.com/group/tiddlywiki.
To view this discussion on the web visit https://groups.google.com/d/msgid/tiddlywiki/f370e529-a580-4255-8e5d-a892224b069c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Tobias Beer

unread,
Nov 12, 2015, 3:04:03 AM11/12/15
to TiddlyWiki, jonath...@wolke7.net
Hi Jonathan,

The above is a little messy.

Please describe precisely how you envision your workflow / the conditions a tiddler may be in.

Is it that you want to have both:
  1. individual locking via tag
  2. global locking via secret
If so, why? Why not just 2.?

Best wishes,

— tb

jonath...@wolke7.net

unread,
Nov 14, 2015, 5:40:52 AM11/14/15
to tiddl...@googlegroups.com

Sorry, this should be part of my last thread

https://groups.google.com/forum/#!topic/tiddlywiki/07WVZmjsopE

In short:

################################

How would I

·       allow a user to read a special tagged tiddler, but …

·       prevent him from editing this tiddler by …

·       asking for a password when he clicks the edit button, but still keep …

·       the normal behaviour with un-tagged tiddlers.

 

I’m looking for a behaviour just like the „Encrypt single tiddler“ plugin, with the only exception that one can read a „encrypted“ tiddler without a password – but have to enter the password to enable editing.

################################

 Tobias gave me the following hint:

In $:/core/ui/Buttons/edit :

<$list filter="[all[current]!tag[locked]]">

<!-- only show when not tagged "locked" -->

</$list>

 

Now my code looks like I wrote above and I have the following problem:

 

I do not get a edit button on missing tiddlers when I open the corresponding link and want to start editing this tiddler. But I do want to be able to edit these Drafts unless they are marked with „locked“

 

Any hints again?

 

 

Tobias Beer

unread,
Nov 14, 2015, 11:43:43 AM11/14/15
to tiddl...@googlegroups.com, jonath...@wolke7.net
Hi Jonathan,

There are two issues here, first the solution:

<$list filter="[all[current]!tag[locked]] [all[current]is[missing]] +[limit[1]]">
[[the button]]
</$list>

Now, the thing is, the tag filter does not work like one would expect it to.
When I feed it a non existing tiddler, I expect that tiddler to be returned by [!tag[sometag]].
However, the code suggests otherwise. So, I created an issue for this:

#2077 Bug: !tag[sometag] ignores nonexisting tiddlers

Best wishes,

— tb

jonath...@wolke7.net

unread,
Nov 18, 2015, 6:10:19 AM11/18/15
to tiddl...@googlegroups.com

Hi Tobias,

 

thanks for looking into my issue – your solution is working!

 

And thank you for creating a bug report.

 

Greetings

 

Jonathan

 

 

Reply all
Reply to author
Forward
0 new messages