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

Forums / Developing with Sitefinity / Blog permissions

Blog permissions

4 posts, 0 answered
  1. Richard
    Richard avatar
    24 posts
    Registered:
    25 Apr 2008
    03 Jun 2010
    Link to this post
    I'm aware that 4.0 will have all sorts of granular permissions, but are there any quick workarounds I could use until then to get the blog permissions a little more granular? I would like permission to create and delete blogs to be restricted to administrative users.

    Here's my problem. If I give a certain role permission to delete blog posts - that also gives that role permission to delete entire blogs. The only warning is a popup that says "are you sure?"

    I guess I can sort of accept people having access to each other's blogs - access is logged after all - but deleting an entire blog isn't something that's easily recoverable and if it happened it could be bad.

    At this point the best workaround I can think of is to turn off delete permissions entirely for most users so they will have to ask to have a post deleted. Not very pretty.


  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    03 Jun 2010
    Link to this post
    Hi Richard,

    Here is a quick hack

    1. Map BlogsListView.ascx external template - How to map a template

    <viewSettings hostType="Telerik.Blogs.WebControls.Admin.BlogsListView"
        layoutTemplatePath="~/Sitefinity/Admin/ControlTemplates/Blogs/BlogsListView.ascx" />

    2. Subscribe for RowDataBound event of the GridView control and hide the first column if the user is not an administrator.

    public void Page_Load(object sender, EventArgs e)
    {
        GridView1.RowDataBound += new GridViewRowEventHandler(GridView1_RowDataBound);
    }
     
    void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
            e.Row.Cells[0].Enabled = false;
        }
    }


    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. Frank
    Frank avatar
    25 posts
    Registered:
    14 Jul 2008
    18 Jun 2010
    Link to this post
    Ivan,

    I'm trying to find BlogListView.ascx but I don't see it anywhere in the External Templates. Where is it located?

    And also what file do you put the code in your second code block in?

    Thanks,
    Frank
  4. Radoslav Georgiev
    Radoslav Georgiev avatar
    3370 posts
    Registered:
    01 Feb 2016
    18 Jun 2010
    Link to this post
    Hi Frank,

    This is the path to the file ~/Sitefinity/Admin/ControlTemplates/Blogs/BlogsListView.ascx. Make sure you get the external templates archive from your client account.

    All the best,
    Radoslav Georgiev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about 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
4 posts, 0 answered