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

Forums / Developing with Sitefinity / Unable to "Create" through the API

Unable to "Create" through the API

5 posts, 0 answered
  1. Jason
    Jason avatar
    10 posts
    Registered:
    08 Feb 2012
    16 Feb 2012
    Link to this post
    I'm working through the Developer training and have been unable to "Create" when launching from Visual Studio. I've tried Blogs, News Items, and Events to no avail. It looks as though my content blocks create, but otherwise I get an error like:

    You are not authorized to 'Create..

    I'm using the trial on my laptop. I am logged into the Project Manager as an admin and lauched VS through the admin. I'm figuring it's a permissions thing but don't know how to troubleshoot.

    Thanks for any help.
  2. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    16 Feb 2012
    Link to this post
    Hello Jason,

    Can you tell me whether you are logged in the site while trying to execute the code? You can try suppressing the security checks prior to creating the content item by using the following code:

    manager.Provider.SuppressSecurityChecks = true;

    Kind regards,
    Victor Velev
    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
  3. Jason
    Jason avatar
    10 posts
    Registered:
    08 Feb 2012
    16 Feb 2012
    Link to this post
    Yes, I am logged into the site when this is happening.

    Looks like the SuppressSecurityChecks line is making it work.

    Thanks so much.
  4. Jason
    Jason avatar
    10 posts
    Registered:
    08 Feb 2012
    16 Feb 2012
    Link to this post
    It seems like what is happening is everytime I run from Visual Studio it logs me out of the SF administration area.
  5. Victor Velev
    Victor Velev avatar
    1345 posts
    Registered:
    06 Jul 2015
    17 Feb 2012
    Link to this post
    Hello Jason,

    If you session has expired or start a new instance of the project, you will need to log in again, or use the previously provided snipped in order to run your code without the need of being signed in.

    Greetings,
    Victor Velev
    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
5 posts, 0 answered