.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Post New Web Links

Delete specific permissions programatically in Sharepoint 2010

Posted By:      Posted Date: September 17, 2010    Points: 0   Category :SharePoint
 
I have created a windows application to create custom permission levels(4) in sharepoint 2010 for deployment purpose of our sharepoint site. I am able to create custom permission levels(4) successfully. My requirement is, each time when I run this windows application, I need to check whether those 4 custom permissions levels already exists or not and if they exist, I need to delete those 4 permission levels and recreate them. How can I check whether the site contains these permission levels already and it contains them, how can I delete those 4 only and recreate them?


View Complete Post


More Related Resource Links

Setting permissions of a specific SharePoint workflow

  

We have a very simple workflow whereby an document placed in a public library (INBOX) is moved it to a private library (VERIFY) and then deleted. The workflow works correctly when someone who has access to the VERIFY library drops a record into the INBOX library.  However it does not work when the user does not have access to the VERIFY library.

I was told that I need to "set the AD group associated with a specific SharePoint workflow" but cannot find any reference to this in SPD.

Thanks.

 


SharePoint 2010 Long Starting if start workflow programatically

  

In SharePoint 2010, I'm starting workflow #2 programatically from my workflow #1. See code below:

					SPList currentList = web.Lists[new Guid(ListId)];
					SPListItem currentListItem = currentList.GetItemById(ListItem);

					//resolve any lookup parameters
					string workflowId = base.ProcessStringField(WorkflowIdentifier);

					//find workflow association by name
					SPWorkflowAssociation workflowAssoc = currentList.WorkflowAssociations.GetAssociationByName(workflowId, Thread.CurrentThread.CurrentCulture);

					if (workflowAssoc != null)
					{
						//start the workflow
						SPWorkflow workflow = site.WorkflowManager.StartWorkflow(currentListItem, workflowAssoc, workflowAssoc.AssociationData, SPWorkflowRunOptions.Synchronous);
					}

And workflow #2  will hang with Starting status (1-10 minutes), Then the workflow #2 status would be modified  to Completed.

I couldn't find how to start the workflow # 2 immediately and complete immediately without several minutes delay

User permissions in SharePoint 2010 act differently in http and https

  
I installed SharePoint 2010, created a site (complete with a document library), and assigned user permissions.  Additionally, I set up certificate authentication for all users.  Two problems occur: 1. As the system administrator, when I access the https site, I no longer have permissions to add/edit users 2. When user's, who have permissions to edit/add a document/folder click on "Add document" or the folder icon to add a new folder, they get an error. Any help is much appreciated.

How to Programatically SetCredentials for Secure Store Service Application in Sharepoint 2010 using

  
I have to setup Credentials for Secure Store Service application programatically. To get Stored Credentials I have following code and its working fine. using (SPSite site = new SPSite("http://vtlssp2010Dev")) //using (SPSite site = new SPSite("http://" + System.Environment.MachineName + "/sites/Site_Name"))d { Console.WriteLine(site.RootWeb.CurrentUser.Name); SPServiceContext context = SPServiceContext.GetContext(site); prov.Context = context; try { SecureStoreCredentialCollection cc = prov.GetCredentials(appID); foreach (SecureStoreCredential c in cc) { IntPtr ptr = System.Runtime.InteropServices.Marshal.SecureStringToBSTR(c.Credential); string sDecrypString = System.Runtime.InteropServices.Marshal.PtrToStringUni(ptr); Console.WriteLine(sDecrypString); } } catch (Exception ex) { Console.WriteLine("Unable to get credentials for application " + appID); Console.WriteLine(ex.Message); } Console.ReadLine(); } } All I want is to programmatically do set credentials like explained in this example on msdn. http://msdn.microsoft.com/en-us/library/ff798456.aspx Please help. Shamshad Ali  

Delete Page Layouts and Master Pages in SharePoint 2010

  
Hi I want to delete unwanted Page layouts and master pages in share point 2010. I tried to delete the steps mentioned below as like MOSS 1.Create a New folder 2.Move the page layouts to that New folder 3.Delete the New folder But this approach also failed.. please suggest me to delete... Thanks in Advance ArunWith Love

Sharepoint 2010: Get error: You do not have permissions to have lists and pages within My Site.

  
I am using the administrator login for the sharepoint 2010 farm.  I'm able to access My Site.  However, when I click on My content, I'm getting You do not have permissions to have lists and pages within My Site.   Any ideas?   Thanks.

Sharepoint 2010 uploading documents programatically

  
Hi All I'm a newbie and hoping that someone can help me with a problem that I am having. I have written a WinForms app to upload documents to Sharepoint 2010 document library using client object model. It works great unless the file is more than 3MB. The error returned is "The remote server returned an error (400) Bad Request". The files are being uploaded from my local machine to the SharePoint 2010 site. I searched the internet for 2 days trying to find a solution to this without any joy. I have tried increasing the maxRequestLength and executionTimeout in web.config. The program uses a file stream to put the file in a btye array which then becomes the content of a filecreationinformation object. As I said, it loads files OK if they are less than 3MB, so I think that the code is OK. The max document size in SharePoint is 50mb. I really need some help please....   Blaithin

Creating a new site sharepoint 2010 under parent site with my custom template Programatically using

  
Hi, I have a parent website under which i want to create subsites on the fly using visual studio 2010. The subsites which i want to create have a common stuructre(in temrs of lists & custom). So i saved the template in sharepoint 2010,it becomes wsp and goes into soution gallery. Now how do i use this template say mytemplate.wsp,to create site in visual studio. i tried this using (SPSite site = new SPSite ("http://infml01132:5566/sites/VRND " ))             {                 using (SPWeb web = site.OpenWeb())                 {                                       SPWebTemplateCollection myTemplates = site.GetCustomWebTemplates(Convert .ToUInt32(web.Locale.LCID));                     //SPWebTemplateCollection temlates1 = site.GetCustomWebTemplates(1033);                     //SPWebTemplateCollectio

Unable to delete groups in SharePoint Foundation 2010

  
I have a test group I created in SharePoint that I want to delete (I'm the only user in the group). In the "People and Groups: All Groups" screen I click the edit icon next to the group and then click on the "Delete" button and ok the following warning dialog. However, the group doesn't get deleted. Any idea why this is happening and how to finally delete this group? Thanks.

automatic delete finshed Task in sharepoint 2010

  

Hi

i need to have task delete,then task is finshed.
Is it possible to have them automaic deletet after users have finshed them in sharepoint 2010.

-Tommy


jcksting

delete user profiles sharepoint 2010

  

Hello,

I got an unusual issue with SharePoint 2010.  We use SharePoint as an external Client portal using FBA login authentication.  We have close to 2000 users on this portal.  28 of these users show up with i:0#.f|fbamembershipprovider| in its username and these 28 accounts cant login.  I can't seem to find where they are in the database or how to remove or fix these logins.  Anyone have a suggestion?


Sharepoint 2010 Error "You do not have permissions to access a database"

  

Hi,

When I click a button in a form (designed by Infopath 2010,custom code included,full trust security,deployed and activated by our sharepoint admin)

An error pops out saying:

"You do not have permissions to access a database that contains data required for this form to function correctly.
An entry has been added to the Windows event log of the server.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Log ID:5566

Correlation ID:9161ac7c-7b8f-4164-907a-14426c54b24f"

How

Sharepoint 2010 Error "You do not have permissions to access a database"

  

Hi,

When I click a button in a form (designed by Infopath 2010,custom code included,full trust security,deployed and activated by our sharepoint admin)

An error pops out saying:

"You do not have permissions to access a database that contains data required for this form to function correctly.
An entry has been added to the Windows event log of the server.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

Log ID:5566

Correlation ID:9161ac7c-7b8f-4164-907a-14426c54b24f"

How

SharePoint 2010 Site Permissions

  

Hi,

I had another post about SP permissions but i didn't get this permissions thing.

I a SP site you can have 3 groups: Vistors (Read Rights), Members (Contribute), Owners (Full control). But you can give rights to one user (Limited Contribution or something like this.). To another user you can specify from the list what rights he/she should have.

How you can get programmatically all the users permissions from site x (http://server/sitename) in this format:

+--Visitors (read perm)
    |-User1 (read perm)
    |-User2 (read perm)
    |-User3 (read perm)
+--Members (contribute perm)
    |-User4 (contribute perm)
    |-User5 (contribute perm)
    |-User6 (contribute perm)
+--Owners (full control)
    |-User7 (full control)
    |-User8 (full control)
    |-User9 (full control)
-UserX (full control)
-UserY (read perm)
-UserZ (contribute perm)

 

So we will have to list all the groups from that site all the users from every group, and all the users that have rights on that site but is not member of any SP group (that has specific permissions).

Another thing: in permissions can be specified an AD(active directory) g

How can I specify my search scope on a specific site? using sharepoint 2010

  

Example:

if I’m in Site1 my search scope needs to be specified only to Site1 and when I go to Site2 my search scope needs to be specified only to site2?


Retrieving Base Permissions in sharepoint 2010

  

Hi all,

I am trying to read all base permissions associated with SharePoint Permission Level (RoleDefinition) from a SharePoint 2010 site.
I am using Client object model to do this.

 

ClientContext ctx = new ClientContext("http://myserver/");
RoleDefinition rd = ctx.Web.RoleDefinitions.GetByName("Full Control");
ctx.Load(rd.BasePermissions);
ctx.ExecuteQuery();

 

“It throws an exception at ctx.Load method as "The type 'Microsoft.SharePoint.Client.BasePermissions' cannot be used as type parameter 'T' in the generic type or method 'Microsoft.SharePoint.Clien

Retreiving the url for a folder in the document library in SharePoint 2010 site programatically

  

Hi,

 I want to retreive the url for the folder in the document library using visual studio.And I also want to retreive the subfolder url.Pls help me.

Regards,

Shamia


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend