Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9242367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:33:59+00:00 2026-06-18T08:33:59+00:00

I have to create a separate web project to access the Roles and Users

  • 0

I have to create a separate web project to access the Roles and Users API for sitecore domain, so I can programmatically add new Roles with custom access to the tree as well as custom language access. I have found the documentation for Security API, http://sdn.sitecore.net/upload/sitecore6/sc61keywords/security_api_cookbook_usletter.pdf

But I am not sure how to go about adding a new role, can I just create any type of project, like MVC4 or does it have to be in WebForms? Is this even possible to add custom permission to the tree by adding new roles and assigning them new users through API, so they can just login normally through the SiteCore domain? Also, what database am I supposed to use, I see there are 3 different ones (core,master,web), do I have to manually connect to the database and add roles there, or the API’s will do that for me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T08:34:00+00:00Added an answer on June 18, 2026 at 8:34 am

    I ended up creating a class that lets me add new languages(regions) when needed. Here is the idea I worked with.

    using(new Sitecore.Security.Accounts.UserSwitcher(user) //To switch to any user you want, in my case it was the "sitecore/admin"
    
    
    System.Web.Security.Roles.CreateRole(roleName) //To create roles
    var role = Sitecore.Security.Accounts.Role.FromName(roleName) //To retrieve the role.
    //Get a list of the permissions that you would like to set
    //For every item in that list
    AccessRuleCollection accessRule = Item.Security.GetAccessRules();
    acessRule.Helper.AddAccessPermission(role,AccessRight,PropagationType,AccessPermission);
    
    //Write the Rules back to the item
    Item.Editing.BeginEdit();
    Item.Security.SetAccessRules(accessRules);
    Item.Editing.EndEdit();
    

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Web API project with models that look like this: public class
I'm new to silverlight. I got a separate class file in web project and
I have a php page with 3 different forms. I create 3 separate print
Let's say that I have a SQLite database that I create in a separate
I have created web project in struts2.in that i have plotted a graph using
Let's say you have 2 totally separate projects: Project 1 and Project 2. One
I have some projects: WebShared (Java Library project) WebExternal (GWT Web Application) WebInternal (GWT
I have a web project that stores objects in raven db. For simplicity the
I have a web service that is quite heavy on database access. It works
I'm working on a project where I have 2 web services that need the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.