Anyway, the "else" macro threw an error, since it doesn't exist, but I
simply replaced it with <span macro="showWhen !
window.simpleRoles.contains('Admin')">.
It works great! :D
Thanx.
w

On Sep 24, 9:47 am, whatever <[email protected]> wrote:
> Hi!
>
> 1. Good to know.
>
> 2. Evalify errors:
> in tiddler Evalify:
>    Error while executing macro <<evalify>>: SyntaxError: unterminated
> string literal
> and
>    Error while executing macro <<evalify>>: SyntaxError: missing ;
> before statement
>
> In tiddler SimpleRoles:
>    Error while executing macro <<evalify>>: ReferenceError: User1 is
> not defined
> and
>    Error while executing macro <<evalify>>: ReferenceError: Guest is
> not defined
>
> 3. It was late last night and I wasn't thinking clearly, even though I
> had already done exactly that. :D
>
> 4. Ok, I'm clear on that.
>
> 5. Well, the funny thing is that I had read that and then I spent the
> entire night practically dreaming that I'd found an easier way to do
> it without your plugin, but when I read your answer this morning, I
> realized that I can do it WITH your plugin. :D Also, this example is a
> bit clearer because of the "else" macro.
>
> 6. A useful thing.
>
> Thanx.
>
> w
>
> On Sep 24, 1:51 am, Tobias Beer <[email protected]> wrote:
>
> > Hi whatever,
>
> > Some answers...
> > 1) Is the EvalifyPlugin required?
> > No, not unless you want to display the user role on TiddlySpace as I
> > did. In a Non-TiddlySpace-TiddlyWiki you can use the tiddler macro
> > like so...
> > Tiddler:GetRole
> > <<tiddler GetRole##OUT with {{window.simpleRoles[0];}}>>/%
> > !OUT
> > $1
> > !END%/
>
> > 2) Because I keep getting errors.
> > Where, when, which?
>
> > 3)  Also, I'm not clear on how to assign roles.
> > Simply put the user-names into the corresponding sections of your
> > SimpleRolesConfig tiddler.
>
> > 4) Do I need to use something like <<option simpleUserRole>>? And
> > where do I put that?
> > Of course not, or do you want your users to choose their own role?
> > Again, you assign roles to users in SimpleRolesConfig.
>
> > 5) And how do I define, to which tiddlers a User has access as opposed
> > to an Admin or PowerUser?
> > You would have to use conditional templating as in the example. You
> > could also define different restrictions for search with
> > YourSearchPlugin or GotoPlugin... and then include those
> > conditionally.
>
> > As an example using HideWhenPlugin...
> > <span macro="showWhen window.simpleRoles.contains('Admin')">
> >         <span id='mainMenu' refresh='content' 
> > tiddler='MainMenuAdmin'></span>
> > </span>
> > <span macro="else">
> >         <span  id='mainMenu' refresh='content' tiddler='MainMenu'></span>
> > </span>
>
> > The same way you could hide the entire tiddler content.
>
> > 6) Do I need to create tiddlers with usernames?
> > Not when it comes to roles, no.
>
> > You could, however, tag tiddlers with a role - like "Admin" - and then
> > use a conditional statement to check if the role is assigned to the
> > current tiddler AND the current user.
>
> > Cheers, Tobias.

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWiki" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywiki?hl=en.

Reply via email to