+ Reply to Thread
Results 1 to 8 of 8

Thread: Showing elements on a page based on permissions

Hybrid View

  1. #1
    Join Date
    Jan 2012
    Posts
    89

    Default Showing elements on a page based on permissions

    Hi guys,

    I have a few pages (including my home page) where I would like to show certain content (text, embedded, videos, etc.) to my contributor user group but not show that content to my standard users. The main content of the page should be seen by everyone though. Is this possible to do? If not can someone tell me how I can go about creating specific pages for my contributors that the standard users don't have access to (even though this is less ideal since the contributors will need to click on the separate pages)?

    Thanks!

  2. #2
    Join Date
    Jan 2012
    Posts
    89

    Default

    Bump. Is this possible?

  3. #3
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    You can use wiki.page() to include contents from another page. If the user doesn't have permission to view that other page, the contents won't be included.
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

  4. #4
    Join Date
    Jan 2012
    Posts
    89

    Default

    Thanks Steve! I'll give it a shot.

  5. #5
    Join Date
    Jan 2012
    Posts
    89

    Default

    I tried out wiki.page() and it seems to do most of what we need. A few follow-up questions though.

    1. Is it possible to include HTML code in a page that is permissions-based instead of having to include an actual page from the wiki? For example, I'd like to just include some text and a link?

    2. Can we tie page permissions to roles instead of groups? For example, I would like to tie a specific page to the "Authors" role so only they can see it and I'll also embed it in the home page. I have manually added several hundred users into this role but it seems that permissions are only tied to users and groups. Does this mean that I now need to add all these hundreds of users into a new group? Is there any other option?

  6. #6
    Join Date
    Jul 2006
    Location
    San Diego, CA
    Posts
    5,450

    Default

    1. You could embed code that checks if the user looking at the content meets certain conditions before you display the content. However, this only hides content when rendered, but still displays it when edited. For example:
    Insert a DekiScript block, then put in it as plain text:
    if(!user.anonymous) <p> "Hi logged in user!" </p>

    2. Roles are only used to grant sets of permissions. They don't exist otherwise. What you want to do is to create an 'Authors' group that has the 'Author' role and add everyone to that group. That's the only way to do it.
    Steve G. Bjorg - Chief Architect
    Did you check the MindTouch FAQ?
    Found a bug? Report it.
    Follow me on Twitter
    Find us on IRC: irc.freenode.net #mindtouch

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts