Regarding creating SharePoint custom permissions not permission level

Hi All,
i want to create or manage custom permissions under permission level.
like
for list items Manage Lists and add items etc.
Thanks in advance.
Kindly suggest me some suggestion
Varsha Patil

Use SPSecurityTrimmedControl control to for specific users or group. But still SPSecurityTrimmedControl will not work for full control so you also need to customize permission for full controls users.
First go to permission level page and modify the permission for full control. uncheck the permission for whom you don't want to show this control (refer below link to know about base permission)
http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx
Then do the same for custom permission level. and now assign this custom permission to group. Later use  SPSecurityTrimmedControl in above menu and then hide/show control for users.
http://social.technet.microsoft.com/Forums/en-US/9496525a-3f8f-47e3-a3c0-73d9a1670b0d/how-to-make-the-site-actions-menu-invisible-to-certain-users?forum=sharepointgenerallegacy
http://social.msdn.microsoft.com/Forums/en-US/0dba2a60-204d-44d9-968f-84cd41f52e2d/how-to-hide-site-actions-menu-for-user-group?forum=sharepointcustomizationlegacy
Hemendra:Yesterday is just a memory,Tomorrow we may never see
Please remember to mark the replies as answers if they help and unmark them if they provide no help

Similar Messages

  • How to create a custom measure for each level of a dimension

    Hi all!
    Can Anyone please explain me with an example, how to create a custom measure for each level for a dimension? I dont mine if you use
    one or more measures.
    thanks in advance
    hope someone helps me.

    For example:I create a dimension for product_dim witch has 4 levels:total, class, family and item:
    d_aben18
    n1_aben18
    n2_aben18
    n3_aben18
    n4_aben18
    herarchy:h_aben18
    cube:cubo_aben18
    measure:med_aben18
    I create this code to fetch the data to the dimension:
    TRAP ON CLEANUP
    SQL DECLARE c1 CURSOR FOR SELECT-
    total_product_id,1,'N1_ABEN18',total_product_dsc,-
    class_id,1,'N2_ABEN18',total_product_id,class_dsc,-
    family_id,1,'N3_ABEN18', class_id, family_dsc,-
    item_id,1,'N4_ABEN18',family_id,item_dsc-
    FROM PRODUCT_DIM
    "OPEN THE CURSOR
    SQL OPEN c1
    "FETCH THE DATA
    SQL FETCH c1 LOOP INTO-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N1_aben18_LEVELDEF,:D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N2_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N3_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    :APPEND D_ABEN18, :D_ABEN18_H_aben18_HIERDEF,:D_ABEN18_N4_aben18_LEVELDEF,:D_ABEN18_parentrel,-
    :D_ABEN18_long_description,-
    "SAVE THE CHANGES
    UPDATE
    COMMIT
    CLEANUP:
    SQL CLOSE c1
    SHOW 'KK2'
    Then I create a cube with use compression off, and in rules sum for example.
    After, I create a measure and I select Override the aggregation specification for the cube, in rules I put nonadditive and I would like to create aprogram to assign distinct values to each level of the dimension. For example, I put 1, 2 3, and 4 values, but at the end I would like to put count(distinct(values)).
    for that I create another program:
    VRB D_RETURN DECIMAL
    if D_ABEN18_N1_ABEN18_LEVELDEF eq 'N1_ABEN18'
    then D_RETURN = 1
    if D_ABEN18_N2_ABEN18_LEVELDEF eq 'N2_ABEN18'
    then D_RETURN = 2
    if D_ABEN18_N3_ABEN18_LEVELDEF eq 'N3_ABEN18'
    then D_RETURN = 3
    if D_ABEN18_N4_ABEN18_LEVELDEF eq 'N4_ABEN18'
    then D_RETURN = 4
    else d_return=26
    return d_return
    "SHOW D_RETURN
    cubo_aben18_med_aben18_stored=d_return
    but it doesnt work.I dont know how to put to assign or to see what I want.
    I report the measure, or I report the program, but then how can I see the values of the measure?
    thanks in advance

  • Creating SharePoint Custom List using a list using a Microsoft.SharePoint.Client.ClientContext object: Lists.Add method from existing Template does not Include Template Content (include content was checked for template)

    The code below works assuming you have a list template setup called "GenTasksTemplate".
    The problem is that even though the check box to include content was checked during the creation of the template, the task items in the new list do not get populated.  What am I missing?
    using System;
    using System.Linq;
    using Microsoft.SharePoint.Client;
    protected void createSPlist(object sender, EventArgs e)
    ClientContext context = new ClientContext("https://sharepointServer/sites/devcollection/");
    var web = context.Web;
    ListTemplateCollection ltc = context.Site.GetCustomListTemplates(context.Web);
    ListCollection siteListsColection = web.Lists;
    context.Load(ltc);
    context.ExecuteQuery();
    ListCreationInformation listCreationInfo = new ListCreationInformation
    Title = "New Task from Template",
    Description = "Tasks created from custom template"
    Microsoft.SharePoint.Client.ListTemplate listTemplate = ltc.First(listTemp => listTemp.Name == "GenTasksTemplate");
    listCreationInfo.TemplateFeatureId = listTemplate.FeatureId;
    listCreationInfo.TemplateType = listTemplate.ListTemplateTypeKind;
    listCreationInfo.DocumentTemplateType = listTemplate.ListTemplateTypeKind;
    //listCreationInfo.CustomSchemaXml =
    siteListsColection.Add(listCreationInfo);
    context.Load(siteListsColection);
    context.ExecuteQuery();
    http://www.net4geeks.com Who said I was a geek?

    Yes. I can create a list with the template using the UI.  I can also create list programmatically using the Microsoft.SharePoint library within a Windows Forms Application.  If I do create a provider-hosted app referencing Microsoft.SharePoint,
    it results in a 64bit / 32bit mismatch error.  I am running SharePoint 2013 on a 64 bit Windows 2012 Server.
    The problem is that with a provider-hosted SharePoint App, I am limited to only using the Microsoft.SharePoint.Client library which is very limited.
    http://www.net4geeks.com Who said I was a geek?

  • Project Server 2010 / Sharepoint 2010 Permissions not syncing to Project Site

    Project Permissions not syncing to Project Site
    Project Manager Group
    New project is created and published project server sends permissions to Sharepoint which puts users into the following groups:
    <dir><dir></dir></dir><dir><dir>
    Web Administrator (Microsoft Project Server)
    Project Managers (Microsoft Project Server)
    Team members (Microsoft Project Server)
    Readers (Microsoft Project Server)
    At this time the creator/owner, owner’s management, portfolio managers, and executives should all have Project Manager rights on the sharepoint site, and Admins will have Web Admin permissions.
    Issue #1: Only the Web Admin permissions and creator/owner permissions are being added to the Sharepoint permission groups
    Workaround #1: Going into the project site permissions and adding the
    Project Managers (Microsoft Project Server) group manually and the sync will keep the permissions
    Workaround #2: Going into the Server Settings, Manager Groups then removing or add all users to the No Permission Group, which forces an sync to all workspaces. Con: This workaround can only be down at night when users are not active since it will
    block the queue for at least an hour.
    Project Owner Transfer
    Previously created project has owner change, once saved and published project server sends permissions to update user’s permission to
    Project Managers (Microsoft Project Server) on Sharepoint project site.
    Issue #2: When Project owner is changed and project is published the owner is not getting permissions to the Sharepoint project site. However, if owner is also added to the team using the Build Team Feature the sync will give the owner Project
    Manager permissions on the Project Site.
    Workaround #1: Going into Server Settings, Project Sites, select project and Synchronize. Once this is done, the owner will have Project Manager Permissions without being added to the team.
    Users who have been added to this project in Project Server 2010, but not assigned to tasks. Users who have assignments in this project in Project Server 2010 and are contributors to the project workspace site,
    meaning that they can create and edit documents, issues, and risks. Users who have published this project or who have
    Save Project permission in Project Web App and are contributors to the project workspace site, meaning that they can create and edit documents, issues, and risks. Users who have
    Manage SharePoint Foundation permission in Project Web App and are contributors to the project workspace site, meaning that they can create and edit documents, issues, and risks.</dir></dir>

    By default when you create project build team add users in the task and publish the project plan then All the User which are available in the project plan including Project owner will go to below mentioned group in project site:
    1. creator/owner, owner’s management, portfolio managers, and executives should all have Project Manager will get access to Project Managers (Microsoft Project Server)
    2. User who are having team member access to PWA will get Team members (Microsoft Project Server) access if they are assigned to the project task.
    3. User who are having team member access to PWA will get Readers (Microsoft Project Server) access if they are not assigned to the project task.
    4. Only PWA Administrator will get the access to Web Administrator (Microsoft Project Server)
    Sharepoint permission you have to use when you want to give permission manually to users on project site  
    In the Project Site provisioning setting under Server setting if you have Check to automatically synchronize Project Web App users with Project Sites when they are created, when project managers publish projects, and when user permissions change in Project
    Server.
    Then all the user get access as per describe above and if you will give access manually to any of the user either in project server group or in Sharepoint group once you will publish the project next time all the manually given permission will go away.
    IF you want to give permission to user manually to sharepoint group or project server group then uncheck automatically synchronize Project Web App users with Project Sites when they are created, when project managers publish projects, and when user permissions
    change in Project Server.
    You check PWA site setting --> Site permission then member of Sharepoint group user who will have access to sharepoint group in PWA site setting site permission will have access to all the project site sharepoint group as Project site inherit permission
    from PWA root site.
    Both the issue which you have described is behavior of project site.
    For issue 2 when first time project owner create and publish the project and projectsite is getting created then porject owner name gets access  in the porject manager (project server group) nect time if you will change the owner and publish the project
    until he will not present in the project plan will not get the permission.
    If you want to give sharepoint permission to users then uncheck automatically synchronize Project Web App users with Project Sites when they are created, when project managers publish projects, and when user permissions change in Project Server and give
    the permission manually. 
    Project site in 2010 has some issue and not full filling customer need some time ,Ms has came up with 2013 which is having tight integration with project sites .
    Project workspace security groups are equal to the SharePoint Server 2010 security groups.
    Web Administrator equals Full Control
    Project Managers equals Design
    Team members equals Contribute
    Readers equals Read
    Users who have Manage
    SharePoint Foundation permission in Project Web App and are contributors to the project workspace site, meaning that they can
    create and edit documents, issues, and risks will get access to Web Administrator (Microsoft Project Server)
    http://technet.microsoft.com/en-us/library/cc197668(v=office.14).aspx
    kirtesh

  • Error in SharePoint hosted app: Add permission level to the list programmatically

    I am trying to add permission to the list which I have created in my app. I am trying to give current user some permission to add update delete items from my list. I have used one article from MSDN(http://msdn.microsoft.com/en-us/library/office/jj247079.aspx)
    site. And my code is as bellow:
    function execOperation() {
    debugger;
    context = new SP.ClientContext(appweburl);
    var factory =
    new SP.ProxyWebRequestExecutorFactory(
    appweburl
    context.set_webRequestExecutorFactory(factory);
    appContextSite = new SP.AppContextSite(context, appweburl);
    var appContextSite2 = new SP.AppContextSite(context, hostweburl);
    var siteColl = appContextSite2.get_site();
    hostweb = appContextSite2.get_web();
    context.load(hostweb);
    web = appContextSite.get_web();
    context.load(web);
    user = web.get_currentUser();
    context.load(user);
    que_list = web.get_lists().getByTitle("MyList1");
    context.load(que_list);
    que_list.breakRoleInheritance(true, true);
    var permissions = new SP.BasePermissions();
    permissions.set(SP.PermissionKind.viewListItems);
    permissions.set(SP.PermissionKind.addListItems);
    permissions.set(SP.PermissionKind.editListItems);
    permissions.set(SP.PermissionKind.deleteListItems);
    // Create a new role definition.
    var roleDefinitionCreationInfo = new SP.RoleDefinitionCreationInformation();
    roleDefinitionCreationInfo.set_name('Manage List Items');
    roleDefinitionCreationInfo.set_description('Allows a user to manage list items');
    roleDefinitionCreationInfo.set_basePermissions(permissions);
    var roleDefinition = web.get_roleDefinitions().add(roleDefinitionCreationInfo);
    web.breakRoleInheritance(true, false);
    // Create a new RoleDefinitionBindingCollection.
    var newBindings = SP.RoleDefinitionBindingCollection.newObject(context);
    // Add the role to the collection.
    newBindings.add(roleDefinition);
    // Get the RoleAssignmentCollection for the target list.
    var assignments = que_list.get_roleAssignments();
    que_list.breakRoleInheritance(true, true);
    // Add the user to the target list and assign the use to the new RoleDefinitionBindingCollection.
    var roleAssignment = assignments.add(web.get_currentUser(), newBindings);
    context.executeQueryAsync(onSuccess, onFail);
    I have just copied the code from that article. But when I run my app it give me error :
    You cannot customize permission levels in a web site with inherited permission levels
    Any suggestions, What am I doing wrong?
    Thank you in advance...!

    Problem solved. 
    It turns out there should be NO leading '/' in the relative URL despite the example shown in http://msdn.microsoft.com/en-us/library/office/dn292553.aspx#Folders with "/Shared Folder".
    The correct GetFolderByServerRelativeUrl-parameter in my case is 'Lists/Productdocuments'.
    Unsure whether example is wrong or if it applies to other cases than mine.

  • Query regarding creating a Custom Event and Firing.

    I have created a custom event,a custom listener and a custom button.
    But when I click on custom button,my event is not being fired.
    When and how do I need to invoke the fireEvent() ?
    Please can any body tell me if I have overlooked any thing ?
    Thanks,
    // 1 Custom Event
    import java.util.EventObject;
    public class MyActionEvent extends EventObject{
            public MyActionEvent(Object arg0) {
         super(arg0);
    // 2 Custom Listener
    import java.util.EventListener;
    public interface MyActionListener extends EventListener {
          public void myActionPerformed(MyActionEvent myEvent);
    // 3 Custom Button
    public class MyButton extends JButton {
        // Create the listener list
        protected javax.swing.event.EventListenerList listenerList = new javax.swing.event.EventListenerList();
          public MyButton(String str){
         super(str);
         public void addMyActionEventListener(MyActionListener listener) {
             listenerList.add(MyActionListener.class, listener);
        protected void fireMyActionEvent() {
            MyActionEvent evt = new MyActionEvent(this);
            Object[] listeners = listenerList.getListenerList();
           for (int i = 0; i < listeners.length; i = i+2) {
                 if (listeners[i] == MyActionListener.class) {
                      ((MyActionListener) listeners[i+1]).myActionPerformed(evt);
    } // end of class MyButton.
    // 4 Test my Custom Event,Listener and Button
    public class MyButtonDemo extends JPanel {
        protected MyButton b1;
        public MyButtonDemo() {
            b1 = new MyButton("Disable Button");
            b1.setToolTipText("Click this button to disable the middle button.");
            b1.addMyActionEventListener(new MyActionListener() {
         @Override
         public void myActionPerformed(MyActionEvent myEvent) {
         System.out.println("My ActionEvent....");
            add(b1);
        private static void createAndShowGUI() {
            JFrame frame = new JFrame("ButtonDemo");
            frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            MyButtonDemo newContentPane = new MyButtonDemo();
            newContentPane.setOpaque(true);
            frame.setContentPane(newContentPane);
            //Display the window.
            frame.pack();
            frame.setVisible(true);
        public static void main(String[] args) {
            javax.swing.SwingUtilities.invokeLater(new Runnable() {
                public void run() {
                    createAndShowGUI();
    }

    Hi Stan,
    I would like to use my custom action listener rather that using the the normal actionPerformed(ActionEvent e)
    But some how this event is not being fired.
    Any suggestions to fire this?
    b1.addMyActionEventListener(new MyActionListener() {
             @Override
             public void myActionPerformed(MyActionEvent myEvent) {
         System.out.println("My ActionEvent triggered....");
    });

  • SharePoint custom email not shooting, How to fix this?

    Hi All,
    I trying to send custom email from C# to external user, but mail is not going. But sending to same domain users and find these exceptions in log;
    "Type: SmtpFailedRecipientException, Exception Message: Mailbox unavailable. The server response was: 5.7.1 Unable to relay"
    "Exception thrown from business logic event listener: System.Net.Mail.SmtpFailedRecipientException: Mailbox unavailable. The server response was: 5.7.1 Unable to relay     at System.Net.Mail.SmtpClient.Send(MailMessage message)    
    at ChangeControl3_Nov.eGA_Utility.SendmailnoAttach(String To1, String subject1, String Body1, String frommail1, String FS) in c:\Users\acpbsdt\AppData\Local\Temp\2\Vsta\6c9090f9672f4fba89c20855a223734b\eGA_Utility.cs:line 288     at ChangeControl3_Nov.FormCode.SendBothCTRL256_5_Clicked(Object
    sender, ClickedEventArgs e) in c:\Users\acpbsdt\AppData\Local\Temp\2\Vsta\6c9090f9672f4fba89c20855a223734b\FormCode.cs:line 417     at Microsoft.Office.InfoPath.Server.Util.DocumentReliability.InvokeBusinessLogic(Thunk thunk)     at Microsoft.Office.InfoPath.Server.SolutionL...
    08e3e29c-259c-60b9-fdb2-5829cbd6a566"
    Any idea? Thanks in advance!

    Hi,
    Please check the links below:
    The server response was: 5.7.1 Unable to relay -- Help Please
    http://forums.iis.net/t/1165876.aspx?The+server+response+was+5+7+1+Unable+to+relay+Help+Please
    Mailbox unavailable. The server response was: 5.7.1 ... we do not relay
    http://www.codeproject.com/Questions/94257/Mailbox-unavailable-The-server-response-was
    If you want to customize code for send Mail in SharePoint using C# .net code, here is a blog for your reference:
    https://technologykhabar.wordpress.com/2013/06/19/custom-code-for-send-mail-in-sharepoint-using-c-net-code/
    The code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Net.Mail;
    using Microsoft.SharePoint.Administration;
    namespace SendEmail
    class Program
    static void Main(string[] args)
    SPWebApplication webApp = SPWebApplication.Lookup(new Uri("https://serverName/"));
    MailMessage mail = new MailMessage();
    mail.From = new MailAddress("[email protected]");
    mail.To.Add("[email protected]");
    mail.Subject = "Subject Test";
    mail.Body = "Body Test";
    // SmtpClient class sends the email by using the specified SMTP server
    SmtpClient smtp = new SmtpClient(webApp.OutboundMailServiceInstance.Server.Address);
    smtp.UseDefaultCredentials = true;
    smtp.Send(mail);
    Best Regards
    Dennis Guo
    TechNet Community Support

  • SharePoint 2013 check permissions unable to find permission level for AD user

    In our environment for SharePoint AD groups are associated with individual AD members and AD group is given access to SharePoint group with a permission level. When I want to check for a user who are part on the AD group using check permission to find their
    SharePoint permission level it returns "none", but when I check what permission level the AD group has check permission returns correct permission level.
    I am not sure if this is the right behavior for SharePoint 2013 not to display individual AD user permission using check permission, business users have to request IT every time they have to find a user permission level.

    Hi,
    As far as I know, the user permissions which set in AD Groups is not updated immediately to SharePoint Site. The AD group informations are converted into claims and packed into security token issued by the STS (Security Token Service).
    For troubleshooting your issue,you can configure the Token Cache to a smaller value and check the permission level of the user who is granted permissions through AD group:
    https://sergeluca.wordpress.com/2013/07/06/sharepoint-2013-use-ag-groups-yes-butdont-forget-the-security-token-caching-logontokencacheexpirationwindow-and-windowstokenlifetime/
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • Getting an error "Customer could not be determined" for IDOCs in SCM 7.0

    Hi Friends,
        I am executing the report RSMIPROACT in ECC 6.0 system to publish Demand and Stocks into the SCM 7.0 system.
    The IDOC is processed without any errors in ECC 6.0 . However, in the SCM 7.0 system , the IDOC fails with the error.
    I have noticed that 2 things .
    1.  E1ADRE1 field is NOT being sent by the ECC system .
    2. I get the same error even if I manually add this field and add value 300 or 301 for the qualifier field.
    Has anybody faced this problem before ?
    I look forward to replies.
    Detailed error is given below.
    Regards,
    Ranjini.
    Customer could not be determined
    Message no. /SAPAPO/EDI010
    Diagnosis
    The system must determine the customer number from the IDoc data in order to update stock and sales figures for customers. It uses the additional section E1ADRE1 with the qualifier '300' or '301' in the vendor address section to do this. The customer number stored here should have a valid customer number in the APO System.
    The section was not available in the processed IDoc.
    System Response
    The system cancels processing.
    Procedure
    Configure the EDI convertor in such a way that the corresponding section has a value.

    Hi Ranjini,
    Please look into the following
    1) Customer master data is fully maintained
    2) Customer number ranges are fully defined in customisation
    3) Customer address details are maintained
    4) Is there any special characters used while defining customer data or customer
    number like $, #,[ etc.,?
    5) Customer int models are active in SCM side prior to IDOC processing (including
    customer, demand, stocks etc)
    Please confirm your findings
    Regards
    R. Senthil Mareeswaran.

  • How to create a Custom form Template..

    Hi Eperts,
    I would like to seek a help from you regarding creating a custom form template on custom BO. could you guide me where i have gone wrong in successfully creating a Print form. I am in dead need of this particular solution for a client. It is hampering my entire scenario......
    1. I had created a Custom BO and I am trying to preview the created form on the OIF screen.
    2. I had created a form on above of the custom BO. This created form and form group is activated and configured as of needed by opening it through ALD (Adobe Life Cycle Designer).
    3. I had created a BAC element with some scoping questions and activated it. After activating it i had deployed the Business configuration.
    4. my solution got updated with the created and deployed BAC elements and i had done scoping for those elements to make my created form available.
    5. I can see my form template in Form Template maitaince under Application user managment WOC. I had made it to be available for all users and published.
    6. All the above steps are done success fully with no errors.
    7. When i accessed my custom BO and tried to preview the created form i am unable to view it and i am seeing the following window.
    Could you help me out in solving this or send me across any detailed document regarding this what you had done previously.
    Thanks in advance for your valuable help...
    Regards...
    Hanu K

    It looks like system didn't identify the form template. So please check if the required configuration for "Preview" modal dialog is done properly. In the SDK documentation, refer to section "8.4.3.4 Create a Preview Button for a Print Form"
    If you have already done the steps mentioned in the section 8.4.3.4, but still facing the issue then let me know.
    Best regards,
    Hari

  • Report RSMIPROACT gives Customer could not be determined for IDOCs

    Hi Friends,
    I am executing the report RSMIPROACT in ECC 6.0 system to publish Demand and Stocks into the SCM 7.0 system.
    The IDOC is processed without any errors in ECC 6.0 . However, in the SCM 7.0 system , the IDOC fails with the error.
    I have noticed that 2 things .
    1. E1ADRE1 field is NOT being sent by the ECC system .
    2. I get the same error even if I manually add this field and add value 300 or 301 for the qualifier field.
    Has anybody faced this problem before ?
    I look forward to replies.
    Detailed error is given below.
    Regards,
    Ranjini.
    Customer could not be determined
    Message no. /SAPAPO/EDI010
    Diagnosis
    The system must determine the customer number from the IDoc data in order to update stock and sales figures for customers. It uses the additional section E1ADRE1 with the qualifier '300' or '301' in the vendor address section to do this. The customer number stored here should have a valid customer number in the APO System.
    The section was not available in the processed IDoc.
    System Response
    The system cancels processing.
    Procedure
    Configure the EDI convertor in such a way that the corresponding section has a value.

    Hi,
    i'm facing the same problem. Could you solve it?
    Regards

  • Check if Custom Permission level exists or not

    I have cretaed a custom permission level.
    On feature activation, i need to check if that custom permission level exists or not. How can i do that?
    Thanks,
    Avni Bhatt

    Check if below helps
    SPWeb web = SPContext.Current.Web;
    // Validate the page request to avoid
    // any malicious posts
    if (Request.HttpMethod == “POST”)
       SPUtility.ValidateFormDigest();
    // Get a reference the roles that are
    // bound to the current user and the role
    // definition to which we need to verify
    // the user against
    SPRoleDefinitionBindingCollection usersRoles = web.AllRolesForCurrentUser;
    SPRoleDefinitionCollection roleDefinitions = web.RoleDefinitions;
    SPRoleDefinition roleDefinition = roleDefinitions["Full Control"];
    // Check if the user is in the role. If not
    // redirect the user to the access denied page
    if (usersRoles.Contains(roleDefinition))
       //Check if post back to run
       //code that initiates the page
       if (IsPostBack != true)
        //Do your stuff here
    else
       Response.Redirect(“/_layouts/accessdenied.aspx”);
    http://blog.rafelo.com/2008/10/13/programmatically-checking-user-roles-or-permission-levels-in-sharepoint-2007/
    http://yoursandmyideas.wordpress.com/2011/10/08/setting-custom-permission-levels-in-sharepoint-programmatically/
    Or check if it exist and then delete and recreate it
    string[] yourCustomRoles = {"Level1", "Level2"};
    using (var web = spSite.OpenWeb())
    var roles = web.RoleDefinitions;
    foreach(var levelName in yourCustomRoles)
    try
    roles[levelName];
    roles.Delete(levelName);
    catch(Exception)
    // web has no this role
    //Add code here
    http://go4answers.webhost4life.com/Example/delete-specific-permissions-108626.aspx

  • Custom Permission Level Contribute No Delete not working

    I have created a custom permission level that is the same as OOTB Contribute, except it doesn't have the Delete Items nor Delete Versions.
    In my document libraries, I have "require documents to be checked out" set to Yes.
    This is causing some strange behaviour.  When a user (that has my custom Contribute No Delete permission) tries to open a document for editing, they get a message that the document is checked out to their own username, and it won't allow
    them to edit the document.
    What is the best way to remove the "Delete" permission?  We absolutely need this.
    thanks!

    Are you given an option to check it back in via the "back-stage" area? 
    I'd also say that the highest permission grouping wins.  If one group grants a right and another removes it, the additive grouping will win out.  As well as checking the inheritance, it's ideal to remove permissions that might grant this.
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Custom permission levels don't work

    I have created a custom permission level group called custom contribute. The group permission seems to work fine and smoothly one day. The next day that it seems that users of the group can access the site but they cannot do anything else on the site without
    receiving the tell us why you need access message.
    The users in the group are accessing SharePoint from all over the world. Is there something that I can check within the settings  to see why they have access one day and the next they don't? Or is SharePoint setup this way?
    I have full control of the site and nothing changes from day to day. Any help or suggestions on this would be greatly appreciated.

    Hi kedge11,
    Please check permissions for the users with this custom permission level from problematic SharePoint site, verify if they still have the expected custom contribute permissions.
    Also test if this issue could be reproduced, if not, please re-create another same custom permissions for these users again.
    If issue still persists, please check ULS log when this error occurs, it should provide some useful information for helping solve issue.
    Thanks
    Daniel Yang
    TechNet Community Support

  • Share Button not show Permission Level

    Hi,
    We are facing a weird problem in our farm, we have until CU July 2014 versión with an authentication with ADFS2.0.
    In all Site Collections we have breaked the inherited permissions and we gave permissions directly to the SC or by AD Groups, until here, there is no problem
    But recently, we have discovered that the share button in Site collection does not work properly, in some SC it only shows the following:
    But in other sites we have done the same, and it shows correctly the Level permissions of the SC. I have checked that is not a problem with the Custom Master we have deployed, since I have created this SC with the original Seattle Master Page.
    Anyone knows what is happening??
    Thanks

    Hi again,
    With the share button, we have detected the following:
    In SharePoint 2013 Foundation, the share button points to
    http://urlsc/_layouts/15/aclinv.aspx?forsharing=1&lsDlg=1 and it shows both, SharePoint groups and permission levels (Full Control, read, design...) but in SharePoint 2013 Standard and Enterprise, this same share button points to
    http://urlsc/_layouts/15/aclinv.aspx?forsharing=0&lsDlg=1 where only displays SharePoint Groups.
    Anyone knows why this difference? It is a bug? What is the behaviour?
    Thanks

Maybe you are looking for