Hi Drupal devs, In case there's anyone with a bit of spare time coming up, and open to ideas, I've had a thought for what could be (for some) a very useful module. The idea is to have parts of a node marked-up to be visible only to certain roles. This could be achieved with certain SGML-like markups in the node body. For a silly example: <h3>Sale! All boots 35% off!</h3> <restrict role="retailer"> <p>We've picked up a big consignment of factory seconds from China. Faults are very minor, but we can't exactly charge full price for them. Otherwise, they're nice lines, and you should turn them over no problem. When you order stocks, please quote discount code #CNS4414</p> </restrict> <restrict role="admin"> <p>FFS Ian! Get off your butt and fix up those order screens!</p> </restrict> <restrict role="manager"> <p>Sleep easy, Caitlin, we'll get 'em off your hands. You could even come out a bit ahead.</p> </restrict> Grab them while they last from your nearest retail outlet, or <a href="order">order them online here</a>. Thoughts? Cheers David PS - My PHP is way rusty (switched to Python 5 years ago), and I'm just starting to learn the Drupal API. Otherwise I'd have a go at it myself.
The CCK-Field-Permissions module lets you set this at the field-creation level, no embed code needed. It also lets you specify View/Edit/Delete permissions for each field of a node. http://drupal.org/project/cck_field_perms - Ken Rickard agentrickard On 7/17/07, David McNab <rebirth@orcon.net.nz> wrote:
Hi Drupal devs,
In case there's anyone with a bit of spare time coming up, and open to ideas, I've had a thought for what could be (for some) a very useful module.
The idea is to have parts of a node marked-up to be visible only to certain roles.
This could be achieved with certain SGML-like markups in the node body.
For a silly example:
<h3>Sale! All boots 35% off!</h3>
<restrict role="retailer"> <p>We've picked up a big consignment of factory seconds from China. Faults are very minor, but we can't exactly charge full price for them. Otherwise, they're nice lines, and you should turn them over no problem. When you order stocks, please quote discount code #CNS4414</p> </restrict>
<restrict role="admin"> <p>FFS Ian! Get off your butt and fix up those order screens!</p> </restrict>
<restrict role="manager"> <p>Sleep easy, Caitlin, we'll get 'em off your hands. You could even come out a bit ahead.</p> </restrict>
Grab them while they last from your nearest retail outlet, or <a href="order">order them online here</a>.
Thoughts?
Cheers David
PS - My PHP is way rusty (switched to Python 5 years ago), and I'm just starting to learn the Drupal API. Otherwise I'd have a go at it myself.
And the vocabperms module does the same thing for taxonomies. Doug Green 904-583-3342 www.douggreenconsulting.com Bringing Ideas to Life with Software Artistry and Invention... Providing open source software political solutions _____ From: development-bounces@drupal.org [mailto:development-bounces@drupal.org] On Behalf Of Ken Rickard Sent: Tuesday, July 17, 2007 7:05 PM To: development@drupal.org Subject: Re: [development] req: role-specific content in pages The CCK-Field-Permissions module lets you set this at the field-creation level, no embed code needed. It also lets you specify View/Edit/Delete permissions for each field of a node. http://drupal.org/project/cck_field_perms - Ken Rickard agentrickard On 7/17/07, David McNab <rebirth@orcon.net.nz > wrote: Hi Drupal devs, In case there's anyone with a bit of spare time coming up, and open to ideas, I've had a thought for what could be (for some) a very useful module. The idea is to have parts of a node marked-up to be visible only to certain roles. This could be achieved with certain SGML-like markups in the node body. For a silly example: <h3>Sale! All boots 35% off!</h3> <restrict role="retailer"> <p>We've picked up a big consignment of factory seconds from China. Faults are very minor, but we can't exactly charge full price for them. Otherwise, they're nice lines, and you should turn them over no problem. When you order stocks, please quote discount code #CNS4414</p> </restrict> <restrict role="admin"> <p>FFS Ian! Get off your butt and fix up those order screens!</p> </restrict> <restrict role="manager"> <p>Sleep easy, Caitlin, we'll get 'em off your hands. You could even come out a bit ahead.</p> </restrict> Grab them while they last from your nearest retail outlet, or <a href="order">order them online here</a>. Thoughts? Cheers David PS - My PHP is way rusty (switched to Python 5 years ago), and I'm just starting to learn the Drupal API. Otherwise I'd have a go at it myself.
Hi! I solved this exact problem a while back: http://drupal.org/project/restricted_text Instead of SGML like entities, it uses bracket-enclosed text. Also note that (as will probably happen with any module that does this) this will adversely affect caching. HTH, Ricky On Jul 17, 2007, at 7:00 PM, David McNab wrote:
Hi Drupal devs,
In case there's anyone with a bit of spare time coming up, and open to ideas, I've had a thought for what could be (for some) a very useful module.
The idea is to have parts of a node marked-up to be visible only to certain roles.
This could be achieved with certain SGML-like markups in the node body.
For a silly example:
<h3>Sale! All boots 35% off!</h3>
<restrict role="retailer"> <p>We've picked up a big consignment of factory seconds from China. Faults are very minor, but we can't exactly charge full price for them. Otherwise, they're nice lines, and you should turn them over no problem. When you order stocks, please quote discount code #CNS4414</p> </restrict>
<restrict role="admin"> <p>FFS Ian! Get off your butt and fix up those order screens!</p> </restrict>
<restrict role="manager"> <p>Sleep easy, Caitlin, we'll get 'em off your hands. You could even come out a bit ahead.</p> </restrict>
Grab them while they last from your nearest retail outlet, or <a href="order">order them online here</a>.
Thoughts?
Cheers David
PS - My PHP is way rusty (switched to Python 5 years ago), and I'm just starting to learn the Drupal API. Otherwise I'd have a go at it myself.
The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.
On Wed, 2007-07-18 at 09:14 -0400, Richard Morse wrote:
Hi! I solved this exact problem a while back:
http://drupal.org/project/restricted_text
Instead of SGML like entities, it uses bracket-enclosed text.
Also note that (as will probably happen with any module that does this) this will adversely affect caching.
Hi Ricky, I've installed your module in my Drupal 5.1. I created a page node with: This line should be visible to all [restrict:roles=authenticated user] This line should be visible only to authenticated users.[/restrict] [restrict:roles=admin] This line should be visible only to admins.[/restrict] And this is the last line visible to all But when I view it as an anonymous user or ordinary authenticated user, all lines are still visible. Is there anything I'm missing? Cheers David
HTH, Ricky
On Jul 17, 2007, at 7:00 PM, David McNab wrote:
Hi Drupal devs,
In case there's anyone with a bit of spare time coming up, and open to ideas, I've had a thought for what could be (for some) a very useful module.
The idea is to have parts of a node marked-up to be visible only to certain roles.
This could be achieved with certain SGML-like markups in the node body.
For a silly example:
<h3>Sale! All boots 35% off!</h3>
<restrict role="retailer"> <p>We've picked up a big consignment of factory seconds from China. Faults are very minor, but we can't exactly charge full price for them. Otherwise, they're nice lines, and you should turn them over no problem. When you order stocks, please quote discount code #CNS4414</p> </restrict>
<restrict role="admin"> <p>FFS Ian! Get off your butt and fix up those order screens!</p> </restrict>
<restrict role="manager"> <p>Sleep easy, Caitlin, we'll get 'em off your hands. You could even come out a bit ahead.</p> </restrict>
Grab them while they last from your nearest retail outlet, or <a href="order">order them online here</a>.
Thoughts?
Cheers David
PS - My PHP is way rusty (switched to Python 5 years ago), and I'm just starting to learn the Drupal API. Otherwise I'd have a go at it myself.
The information transmitted in this electronic communication is intended only for the person or entity to whom it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of or taking of any action in reliance upon this information by persons or entities other than the intended recipient is prohibited. If you received this information in error, please contact the Compliance HelpLine at 800-856-1983 and properly dispose of this information.
2007/7/19, David McNab <rebirth@orcon.net.nz>:
On Wed, 2007-07-18 at 09:14 -0400, Richard Morse wrote:
Hi! I solved this exact problem a while back:
http://drupal.org/project/restricted_text
Instead of SGML like entities, it uses bracket-enclosed text.
Also note that (as will probably happen with any module that does this) this will adversely affect caching.
I've installed your module in my Drupal 5.1. I created a page node with:
This line should be visible to all
[restrict:roles=authenticated user] This line should be visible only to authenticated users.[/restrict]
[restrict:roles=admin] This line should be visible only to admins.[/restrict]
And this is the last line visible to all
But when I view it as an anonymous user or ordinary authenticated user, all lines are still visible.
Is there anything I'm missing?
Are you applying content filters properly? Ie., make sure that you have a filter that it includes it on site/admin/settings/filters and that you have chosen that filter for your page node. -- Frederik 'Freso' S. Olesen <http://freso.dk/>
On Thu, 2007-07-19 at 12:57 +0200, Frederik 'Freso' S. Olesen wrote:
Are you applying content filters properly? Ie., make sure that you have a filter that it includes it on site/admin/settings/filters and that you have chosen that filter for your page node.
/admin/settings/filters gives me a 404. I've looked all over the admin pages and can't find anything to do with filters. How do I define filters? Is there another module I need to install? Cheers David
On Thu, 2007-07-19 at 23:07 +1200, David McNab wrote:
On Thu, 2007-07-19 at 12:57 +0200, Frederik 'Freso' S. Olesen wrote:
Are you applying content filters properly? Ie., make sure that you have a filter that it includes it on site/admin/settings/filters and that you have chosen that filter for your page node.
/admin/settings/filters gives me a 404.
I've looked all over the admin pages and can't find anything to do with filters.
How do I define filters?
Is there another module I need to install?
Never mind - some kind soul on #drupal-support pointed me to /admin/settings/filters again. Seems I'd mistyped the URL the first time. Restricted-text module is working great now :) Thanks for your help, folks Cheers David
participants (5)
-
David McNab -
Doug Green -
Frederik 'Freso' S. Olesen -
Ken Rickard -
Richard Morse