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 8254071
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:05:00+00:00 2026-06-08T01:05:00+00:00

I am working on SharePoint 2010 . Creating features to automate the custom list

  • 0

I am working on SharePoint 2010 . Creating features to automate the custom list creation. I am assigned a task to automatically set the custom permission of each list using features programatically. I would like to know if it is possible and if yes how.

There are 2 things here:

  1. Custom permission level is to be created with contribute-delete permissions.
  2. This permission and default available permissions are to be set to lists which are custom made using features.

please do specify which methods to override if at all possible. Thanks in advance for your valuable answers.

  • 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-08T01:05:01+00:00Added an answer on June 8, 2026 at 1:05 am

    Override the FeatureActivated method of your feature receiver with code similar to the following:

    public override void FeatureActivated(SPFeatureReceiverProperties properties)
        {
            SPWeb web = (SPWeb)properties.Feature.Parent;
            SPList list = web.GetList(web.Url + "/Lists/MyList");
    
            SPRoleDefinition roleDef = new SPRoleDefinition();
            roleDef.BasePermissions = SPBasePermissions.DeleteListItems 
                | SPBasePermissions.AddListItems 
                | SPBasePermissions.EditListItems;
            roleDef.Description = "Custom permissions deployed by feature";
            roleDef.Name = "Contribute-Delete";
            web.RoleDefinitions.Add(roleDef);
            roleDef = web.RoleDefinitions[roleDef.Name];
            SPMember owner = web.SiteUsers[@"Domain\username"];
            SPUser user = web.SiteUsers[@"Domain\username"];
            web.SiteGroups.Add("Contribute-Delete",owner, user,"A group for contribute delete access");
            SPGroup ContributeDeleteGroup = web.SiteGroups["Contribute-Delete"];
            SPRoleAssignment roleAssignment = new SPRoleAssignment(ContributeDeleteGroup);
            roleAssignment.RoleDefinitionBindings.Add(roleDef);
            list.BreakRoleInheritance(true);
            list.RoleAssignments.Add(ContributeDeleteGroup);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating custom registration forms for Forms Based Authentication for a SharePoint 2010 site,
I have a custom Sharepoint 2010 Web Template and I would like to set
I'm currently working with Sharepoint 2010 and Sharepoint API on creating a document library
I'm having a little trouble with a script I'm working on for SharePoint 2010.
I am working on solution for Sharepoint 2010 c# and asp.net and need to
We are working with Fast Search for Sharepoint 2010 and had some backend setup
I'm working on a webpart for a sharepoint 2010 installation. This has multiple sites,
I'm developing a sharepoint 2010 application. One Part of these application is a List
I have a SharePoint 2010 MySites set up on its own web application. There
I have created a list in SharePoint 2010, initially had the columns Title, Mobile

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.