+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / role based generic content - Show text if logged in as manager

role based generic content - Show text if logged in as manager

6 posts, 0 answered
  1. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    02 Feb 2010
    Link to this post
    Hi

    I would like a generic content control that is locked down

    i.e. only show if assigned to the manager role

    How would i acheive this functionality?

    thanks

  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    02 Feb 2010
    Link to this post
    Hello Meister,

    Please take a look at HACK: How to hide controls from toolbox section in Sitefinity 3.6 .

    All the best,
    Ivan Dimitrov
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  3. Meister
    Meister avatar
    262 posts
    Registered:
    09 Nov 2007
    03 Feb 2010
    Link to this post
    Hi Ivan

    Thanks for this, its useful for something else i was looking at, however, I didn't quite explain myself
    What i'm look for is on the front end.

    So when a user is on the front end website, if they are logged in as "manager" role they will see extra content.

    It would be good to have another generic content control in the backend, which is called "generic content - manager"
    You would then drag this onto the page and put some content in 

    If you weren't logged in and browsing the website, you wouldn't see this content

    hope that explains it better,
    Could you let me know the best way to implement this please?

    Thanks
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    03 Feb 2010
    Link to this post
    Hello Meister,

    You can inherit from any control part of Sitefinity and add some custom logic for this. You can even expose a property, to define roles to see the control on the page. You can find sample how to create a control inheriting from Generic Content here: How to wrap a Generic Content control. All you need to do is to expose a property in which you will list roles and then based on input of this property you will decide who gets to see the content there.

    Best wishes,
    Radoslav Georgiev
    the Telerik team

    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
    Follow the status of features or bugs in PITS and vote for them to affect their priority.
  5. yohanis
    yohanis avatar
    1 posts
    Registered:
    23 May 2011
    24 May 2011
    Link to this post
    Hello Ivan,

    I am new to Telerik world. I need to create a generic content in which I can show/hide specific contents according to the user role. Depending on which user logged in to our site, I need to determine the contents to be displayed to that user. I am thus thinking of extending the genericcontent.

    Can you please give me a hint on how to do this including the classes / interfaces I need to inherit from and implement in some way? Sample code makes things easier

    I appreciate your time

    Yohannes
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    24 May 2011
    Link to this post
    Hello yohanis,

    Please take a look at this post

    http://www.sitefinity.com/blogs/radoslavgeorgiev/posts/10-02-22/roles_selector_and_hiding_control_based_on_user_s_roles.aspx

    Greetings,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Register for webinar
6 posts, 0 answered