Add a base permission to an existing role definition in sharepoint using CSOM

I have to add a base permission to an existing role definition in sharepoint using CSOM Managed API in SP2013, to update base permission of a permission level. I did use below code . But Role definition is not getting updated. What could be the reason? I
have updated RoleDefinition and Web as well but it did not help.
  RoleDefinition rd = oClientContext.Web.RoleDefinitions.GetByName("My Permission");
                      if (!rd.BasePermissions.Has(PermissionKind.ManagePermissions))
                          rd.RoleTypeKind.ToString();
                          rd.BasePermissions.Set(PermissionKind.ManagePermissions);
                          rd.Update();
oClientContext.Web.Update();
                          oClientContext.ExecuteQuery();
Ashish Baranwal To know what you know and what you do not know, that is true knowledge

Hi Ashish,
I tested the same scenario per your post in my environment, and I got the same results as you got.                                                                                                                                                                  
As a workaround, I recommend to delete the permission level and then recreate the permission level with the needed permissions:
ClientContext ctx=new ClientContext("http://sp");
RoleDefinition rd=ctx.Web.RoleDefinitions.GetByName("My Permission");
ctx.Load(rd);
ctx.ExecuteQuery();
if(!rd.BasePermissions.Has(PermissionKind.ManagePermissions))
rd.DeleteObject();
BasePermissions permissions = new BasePermissions();
//add the permissions needed
permissions.Set(PermissionKind.ManagePermissions);
RoleDefinitionCreationInformation roleDefinitionCreationInfo = new RoleDefinitionCreationInformation();
roleDefinitionCreationInfo.BasePermissions = permissions;
roleDefinitionCreationInfo.Name = "My Permission";
roleDefinitionCreationInfo.Description = "My Custom Permission Level";
RoleDefinition roleDefinition = context.Web.RoleDefinitions.Add(roleDefinitionCreationInfo);
context.ExecuteQuery();
Best regards.
Thanks
Victoria Xia
TechNet Community Support

Similar Messages

  • How to check whether a user has permission to create term in Taxonomy Term Store using CSOM ?

    I want to check programmatically whether the current user is a Term Store Administrator or not.

    I am not sure how Tomcat handles this, but you need to use two-way (mutual authentication) request but not enforce SSL between Tomcat and the client browser. This will make the browser prompt the user for the cert they want to send. Then you'll need to tackle the other part of your problem, getting the correct content displayed depending on whether the user sent a cert or not. I'm even less help there than I was on the first part of your question.
    So, yeah - good luck with that
    Lee

  • Assign WB to existing role always require role regeneration

    Dear Expert,
    After we upgrade to BI 7, It appears that everytime when we add a new WB to a existing role in the BEx Analyser, the role didn't generate automatically in the BI backend. This means that the team cannot transport a new WB without a corresponding role generation. We have to transport the new workbook and existing role together.
    But I remenbered that in BW 3.5, we don't need to transport both new WB and existing role. Can anyone tell me if  this is standard practise in BI7.0 or whether there is any configration for this? Thank you very much.
    Best Regards,
    Fuyang

    Hi Fuyang
    In addition to Anil's suggestion one small concern ensure that you havent missed up any of the other workbooks and realted roles...
    Hope its clear a little..!
    Thanks
    K M R
    >
    Chris Fuyang Zhang wrote:
    > Dear Expert,
    >
    > After we upgrade to BI 7, It appears that everytime when we add a new WB to a existing role in the BEx Analyser, the role didn't generate automatically in the BI backend. This means that the team cannot transport a new WB without a corresponding role generation. We have to transport the new workbook and existing role together.
    >
    > But I remenbered that in BW 3.5, we don't need to transport both new WB and existing role. Can anyone tell me if  this is standard practise in BI7.0 or whether there is any configration for this? Thank you very much.
    >
    > Best Regards,
    > Fuyang

  • How to add Reports to existing Role (Urgent).

    Hi Experts,
    I am working in BI7.0 and there are no workbooks in our project.
    There is a Role with two reports. The Role has some users assigned to it.
    One of the Users wants to access two additional reports.
    How should I add those extra two reports to this Role on BW side? Do I have to do something like Publish to Role on the Query side in BEx Analyzer (Query Design Mode)...???
    Thanks in Advance.
    Best Regards,
    Chandu.

    One of the Users wants to access two additional reports?
    if this two reports are new workbooks,  then run the query and save the workbooks directly in the role.  if you dont have access to this role then save it in developer role and ask security team to add them in the user role.
    if this report /workbooks exist in the system and you dont have access to this roles,   then you need to ask secuirty team directly to add them in the user role.  ( give them the role in which this workbooks exist  and the target role where he need to add ,  and give them the transport number ) they will add the role and workbooks in the transpot and give it to you.
    Thanks

  • Existing roles / authorization joining.

    Hello.
    I have to arrange existing roles in SD.
    First issue:
    There are defined roles. I just have to aggregate them (e.g. 3 existing roles in new one .) What should I do?
    Second issue:
    Those roles are subordinated according to plant. I have to add additional "organizational level" : business area.
    Thanks in advance
    / Margaret

    Hello,
    The transaction code for authorisation / user profile maintenance is PFCG, but it is advicable to take the help of a BASIS expert.
    Prase

  • Cannot Add File Share to (any) File Server Role of a Cluster in Windows Server 2012

    Cannot Add File Share to (any) File Server Role of a Cluster in Windows Server 2012...
    Get this message in the Operational Log in "FileServices-ServerManager-EventProvider" section of MS-Windows Eventlogs:
    Exception: Caught exception Microsoft.Management.Infrastructure.CimException: The xsi:type attribute (MSCluster_Property_Resource_Network_Name) does not identify an existing class.
       at Microsoft.Management.Infrastructure.Internal.Operations.CimSyncEnumeratorBase`1.MoveNext(Boolean discardResultsAndErrors)
       at Microsoft.Management.Infrastructure.Internal.Operations.CimSyncEnumeratorBase`1.MoveNext()
       at Microsoft.FileServer.Management.Plugin.Services.FSCimSession.PerformQuery(String cimNamespace, String queryString)
       at Microsoft.FileServer.Management.Plugin.Services.ClusterEnumerator.BuildNodes(ICimSession session, ClusterRole scopeType, String query, IDictionary`2 groupNameToTypeMap)
       at Microsoft.FileServer.Management.Plugin.Services.ClusterEnumerator.GetClusterClientAccessPointNames(ICimSession session, IDictionary`2 groupNameToTypeMap)
       at Microsoft.FileServer.Management.Plugin.Services.ClusterEnumerator.RetrieveClusterConnections(ComputerName serverName, ClusterMemberTypes memberTypeToQuery)
    Thanks for help...(everything else works fine in other type of cluster roles).
    Thomas.

    This issue also happens in fresh Windows 2012R2 installations, not just upgrades from 2008R2!
    I have the issue where I cannot modify any settings on SMB shares.  Here is the stacktrace.  It appears to be WMI related.
    Error: ERROR: Task 'TEST.xxxxxxx.COM-ClusterStorage$-SmbShareUpdate-46bcabf6-1dd4-4a48-a525-5e5d374596c7' has failed: Microsoft.FileServer.Management.Plugin.FSACException: Error occurred while updating an SMB share: The requested operation is not supported.
    ---> Microsoft.Management.Infrastructure.CimException: The requested operation is not supported.
       at Microsoft.Management.Infrastructure.Internal.Operations.CimSyncEnumeratorBase`1.MoveNext()
       at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
       at Microsoft.Management.Infrastructure.CimSession.ModifyInstance(String namespaceName, CimInstance instance, CimOperationOptions options)
       at Microsoft.FileServer.Management.Plugin.Services.FSCimSession.ModifyInstance(ICimInstance instance)
       at Microsoft.FileServer.Management.Plugin.Services.FSCimSession.ModifyInstance(ICimInstance instance, IEnumerable`1 propertiesWithKeys)
       at Microsoft.FileServer.Management.Plugin.Providers.WmiUpdateTaskBase.DoUpdateInstance(ICimSession session, ICimInstance instance)
       at Microsoft.FileServer.Management.Plugin.Providers.WmiUpdateTaskBase.DoWork(Object sender, DoWorkEventArgs e)
       --- End of inner exception stack trace ---
       at Microsoft.FileServer.Management.Plugin.Providers.WmiUpdateTaskBase.DoWork(Object sender, DoWorkEventArgs e)
       at System.ComponentModel.BackgroundWorker.WorkerThreadStart(Object argument)

  • CUP v5.3 SP11.1 - CUP Request button "Existing Roles/Groups"

    Hi!
    Re: CUP v5.3 SP11.1 - CUP Request button "Existing Roles/Groups"
    Can anyone explain why some of our CUP users will see this CUP button in the CUP Request and others will not? Are they missing a UME "ACTION"?
    The button works fine, but it only shows up for some users and not others.
    Thanks for your help!
    -john

    Hello ,
    For Approvers , the button "Existing Roles /Groups" will be visible only when the following "stage" level setting is set
    Change Request Content = Yes
    Add Role =Yes .
    Regards
    -Ranjiv

  • Access Enforcer - REMOVE roles/existing roles inoperant

    Hello
    After some time using the capability to ADD and REMOVE roles when creating a request on Access Enforcer (using the option 'Existing Roles' to REMOVE), now Access back to the screen to ADD always that we try to access 'Existing Roles'.
    So, the function to REMOVE roles are inoperant.
    Any ideas what It cold be?

    Hi,
    When you open a changing access request it's possible to add new roles and remove existing roles from the user, right?
    However, the option to remove roles (which is accessed through the 'existing roles' button) is not working longer.
    When that option is accessed, it's not showed anymore the current user's access: the screen returns to the add roles option.
    I haven't found any setting for the feature to remove roles and still don't know how that option, previously used in other requests, is not working for anyone else.
    Regards
    Heverton Kesseler

  • CC 5.2 - Risk Analysis on existing roles

    Hello,
    When I submit a change request via AE 5.2 in order to add a role to an existing user,
    does CC 5.2 perform the risk analysis to the user corresponding roles (existing roles + new one) or only for the role to be added?
    Thank you for your answer.
    Abderrahim

    Hi Abderrahim,
    Yes. It will perform a risk analysis with the existing roles + newly added role. You should enable this in the CUP.
    Go to Configuration --> Risk Analysis -> Set the default risk analysis level.
    Regards,
    Raghu

  • Extend an existing non-Apple wireless network using an Extreme base station

    I have an existing wireless network via a Belkin modem/router. I would like to add my Airport Extreme base station to this existing wireless network, however this appears difficult. Can anyone help me please?

    Hello IanWhite. Welcome to the Apple Discussions!
    I have an existing wireless network via a Belkin modem/router. I would like to add my Airport Extreme base station to this existing wireless network, however this appears difficult.
    Unfortunately, most non-AirPort routers are not compatible with Apple's implementation of Wireless Distribution System (WDS)...so it very unlikely that your Belkin router can be extended wirelessly with the AirPort Express Base Station (AX).
    The few that are known to work are:
    o Linksys WRT54G or WRT54GS (not v5)
    o Belkin F5D7230-4 and F5D7231
    o BT Voyager 2091
    o Netgear WGR614 v6
    o Buffalo WGR-G54
    Is your Belkin one of the models in the above list?

  • IDOC - add new field in in existing segment definition

    Hi,
    For segement type say Z1MARA1 if we need to add a new field in segement definition say Z2MARA1 SAP is not allowing to add new field if we tried to cancelled the realsed 30E it not allowing since the SAP realease which we are working is 640 so only we can create new segement defination with version Z2MARA1001 with new field added but issues is that the partner Profile for outbound parameters the Segment release in IDOc Type is 31I so if we change this segment release in IDOC type to new version ie., 640 then it will pick all the new segement associated with it due to which the the format in which we pass the segements to third party will change so is there any way to use the existing segment definition which is release 30E & add addition field to it. Only one way I found is that when i try to cancel the released message is trigger so in the debug if I make it success it allows to add new field in existing segment definition but which is wrong way of doing is there any way we can used same segment definition & add new field without adding new version & new released.
    Thanks in advance.
    Rajeev

    Varma,
    I know that we can add new segement with new version my question is existing segement definition can we add a new filed because in partner profile we specified release 31i so even we create new segement type then version will be 640 so it will not pick the latest version.
    Thanks
    Rajeev

  • HT5312 You never said how can i add a rescue email to my existing account

    You never said how can i add a rescue email to my existing account

    http://support.apple.com/kb/HT5312

  • How do you add an Airport Express to an existing Airport Express network

    how do you add an Airport Express to an existing Airport Express network

    I assume that you are interested in using the new Express to extend the wireless range of the other.
    If so, please check out the following Apple Support article.

  • How do i add a rescue email to an existing apple id

    Is it possible to add a rescue email to an existing apple ID? If so, what are the steps?

    Hello wardemaddison,
    The following article details the process of adding or changing your Apple ID's rescue e-mail.
    Rescue email address and how to reset Apple ID security questions
    http://support.apple.com/kb/HT5312
    Cheers,
    Allen

  • Why can't I add Family Base to my plan?

    I have tried unsuccessfully many times to add Family Base to my plan. I have blocked numbers from calling/texting my son's phone, but it doesn't really help when he just calls them. I need to be able to block him from calling these people as well. He has a Motorola Droid 4 and I have a Samsung Galaxy S III Mini. I am told that the phones are compatible, but for some reason, I can't add this feature. I continue to get the same error message every time. What can I do?

        Csummers0321,
    This is very strange to hear! We may need to work a little magic on our end to get FamilyBase added. I've requested to follow you. Please accept, follow me back, and then use these steps http://vz.to/1cOOY6O to send me a Direct Message.
    SarahO_VZW
    Follow us on Twitter @VZWSupport

Maybe you are looking for

  • Swap space problem on Windows XP

    I'm trying to install BI Publisher on Windows XP from a zip file downloaded last week (version 10.1.3.3.2). However after starting setup.exe in the install directory I get the message that my swap space = 0 Mb while 500 Mb is required. After this the

  • Error while crawling LOB contents (Error caused by exception: Microsoft.BusinessData.Infrastructure.BdcException)

    Everytime when I perform a Full Crawl on the Central Administraion page, this error will appear and the crawl process will run into an infinite loop and nothing crawl success. I have tried delete and re-create the crawling content sources, start/stop

  • Windows 7 Driver for HP 1215 Photosmart Printer

    I've just bought a Windows 7 laptop, and followed these instructions for installing a printer driver for my HP Photosmart 1215 printer.  However, the printer is on the network, attached to my desktop computer.  I'm having no success adding it as a ne

  • My BH-504 won't boot ...

    Hi, I've bought the new BG-504 bluetooth headset and I recieved it today. I tried it and it was fully working. But 1 or 2 hours later,it's impossible to start it again ... the battery is full (green light when plugged), but pressing the multifonction

  • Logic board Q

    Does anyone know if a logic board from Dual USB G3 12" will fit in a Dual USB G3 14"?