Sharepoint 2010 Break permission inheritance - sharepoint-2010

I need to create a workflow that would break permission inheritance in a sharepoint subsite.
I am building a sharepoint 2010 site that is highly modular and can expand based on clients needs. The project requirement is that the client must be able to expand the website and add subsites from templates with as little interaction as possible. To this end I have created a list and attached a workflow to this list that creates a new website based on the information supplied in the list fields. The workflow I am using is a solution I found online http://www.ilovesharepoint.com/2011/02/create-site-action-sharepoint-designer.html
After the website is created I need to create security groups (another workflow I found online helps with this).
The problem is that the subsite must inherit security groups from the parent site and then I need to add new ones. In order to do this I need to break inheritance from the parent site and than I can create new groups. Currently my client has to do this manually - very bad thing. So I need create a workflow that would do just that.
The problem is that I am completely clueless as to how to go about doing this.
Ideally, I would like to create some sort of workflow action that would take a site url as input and then break permission. From what I've been able to find I need to use BreakRoleInheritance function to do that. but how do I create a workflow that takes input and how do i convert the string input into an actual site?
Like I said, I don't know anything about coding for sharepoint so please be as specific as possible.
Thank you very much.
P.S. maybe I am mistaken and i don't need to break inheritance to create additional security groups that would work only for a given subsite. If so, please tell me how to do this without breaking inheritance.

Related

Use Piranha CMS Manager editor in application for other users

I am trying to create some dynamic forms using Piranha CMS. As far as I managed to learn it is not supported right now, so I'm looking for work arounds or alternatives.
What I want to do now is use the editor from the manager for other users. To be more precise: this is how the editor looks like inside my manager when I want to edit a page
I have a text input and a select, both are Fields and there are many more fields to be used.
I want the sys admin to create a page with a list of inputs like this, which right now are usable only by the admin. BUT make this list of inputs available for edit to other users as well. Is it possible?
I'm not sure how to extract this editor or behavior or even if it is possible. The problem is we really need the admin to be able to configure different form inputs for users as it is the main core of our functionality.
Any help/advice is highly appreciated, thank you!
The components in the management UI is not designed to be reused in the front-end application in any way. The edit models in the manager contains a lot of extra meta data since the UI is completely generic. If you want to build an edit UI in your front end application, and you're using MVC or Razor Pages, the simplest way is to.
Get the generic model instead of your strongly typed model, for example api.Pages.GetById(...) instead of api.Pages.GetById<T>(...).
Loop the available fields in your selected region (a region is an ExpandObject which can be casted to an IDictionary<string, object>).
Use the built in support in Razor by calling #Html.EditorFor(...) for the fields.
Using this approach you can easily create your own EditorTemplates for the different types of fields you use that will match the rendering in your client application.
Best regards
HÃ¥kan

Approach for SharePoint file upload workflow

I'm working on a project that is basically a file upload "wizard" that basically does the following:
Entry form to select document library and enter some basic info.
Enter additional library-specific information.
Tie in some calendar events.
My goals are:
- Create this as a sandbox solution using Visual Studio
- Avoid hacks and reinventing existing functionality as much as possible.
Some SP features I have run across that might be useful:
- Content organizer feature.
- Association forms.
- Declarative workflows.
Possible approaches I've considered:
A content organizer library that kicks off a workflow on submission. Not sure what the user experience for this would be like. Really hoping to keep to a single link -> Next -> Next -> Done kind of approach.
A declarative workflow with custom actions containing all the complexity.
An association form in front of the built-in document upload form for each library with a follow-on association form for calendar events.
Is this feasible and if so which approach is simplest?
I think I've come to my own conclusions on this. I've decided to go with a Drop Off library as part of the Content Organizer built-in feature (#1 above). This appears to be the simplest approach so far since I can do the majority through configuration in the Entity.xml files of the features. Many of the other methods I tried seems like they would require functionality not available in a Sandbox solution.
In order to achieve this, I defined site columns and added them to custom Document Type, then added this Document Type to all libraries. Using the Drop Off library, I can define rules to move the file based on one of the fields in the custom Document Type. I'm hoping to do any follow-up steps as a workflow that kicks off on the Drop Off library when a file is uploaded or as an Associated Form.

Umbraco 5 newb: Content from custom Table

I am currently investigating the possibilities of different CMSs for a company-site.
Done quite a few projects in classical ASP, ASP.NET, Joomla etc..
I would like to use Umbraco 5 for the first time.
For that project we have a SQL-Table with Job-Opportunities:
like: JobName, Department, Description, etc..
These should be listed on a page. In ASP.NET I would use something like a Repeater, etc.. with PageSize option and automatic paging.
In the Backend (Backoffice in Umbraco, I assume) there has to be an Insert/Edit/Delete Page with the corresponding input boxes, which are maintained by the company employees, not by web-developers.
Which route should I look at? I am completely stuck, is there an example anywhere?
Can I use my own data-tables, or could/should I use the Umbraco content tables for this?
Thank you,
Reinhard
Welcome to Umbraco.
If you choose to use a pre-existing database, you're going to need the following pieces:
an ORM to access read/write the data
a custom hive provider for that data to allow for Umbrace to read it as an entity
a custom tree to allow for editing and adding data in the backoffice
a macro to display the content on the frontend.
http://web-matters.blogspot.com/2011/11/umbraco-5-hive-provider-tree-editor.html
is a great place to start.
As you're probably picking up on, this is a lot of work.. so, most importantly: Are you trying to maintain two applications?
If so, do you really need to be able to edit the list in both applications? Your task would be much simpler if you only allowed editing from the other application, and displayed the read-only list using web services.
If not, ditch the custom database. Umbraco 5 is a full EAV/CR system, so unlike some CMS products, you'll be able to represent any rdbs structure you can imagine. The simplest way would be to create a custom document type with those properties to represent a job opportunity, and store those job opportunities on a new node in the content tab.
About document types: http://our.umbraco.org/wiki/how-tos/working-with-document-types

SharePoint 2010 MySites: How can I disable the ability to create blogs in MySites?

Like the title says, I'm looking for a way to restrict user creation of blogs in MySites. I've been researching this for the past few days and can't seem to find a good option.
Presently, I'm hiding the links to create a blog through a custom Master page. I'm using feature stapling to add the custom Master page to MySites which is working; however, not really a 'best practice' since using the URL to create the blog site will still work.
I also don't want to manually change files in the SharePoint root directory structure as it is a poor practice in an upgrade path.
I would appreciate any insight...
If you're hosting MySites in a separate Web Application, you can use an Event Receiver (derived from SPWebEventReceiver and implementing WebAdding) and check that the WebTemplate is BLOG.

prevent duplicate site / page / layouts / templates / webparts, possible

We have a sharepoint environment with many sites (and sometimes many site collections). Each site (or site collection) has the same default page with some custom webparts that use sitecolumn values (for example a projectcode or clientcode) to show information from external systems. (for each project we have to create a separate site (or site collection) because of other reasons)
What is the best approach to minimize duplication? The dynamic parts of the page are stored in site columns. When we add a new webpart, ideally the default page every site/page should show the new webpart without spreading the update to the individual pages
Thanks
One approach you may want to take is to use the web part as a wrapper for a user control. The user control does the heavy lifting on the site. Once the web part is included on your pages, the user control should be able to tell which site it is being executed on and pull the necessary dynamic data from your site columns.
When you need to make updates, you update the user control and then redeploy the solution package to the farm. Each site will pick up the change as soon as the solution is deployed.
Here is a little information about this approach:
http://msdn.microsoft.com/en-us/library/ff649867.aspx.
The above article relates to WSS 3.0, but that should give you a starting point.
An approach you may want to look at for SharePoint 2010 is a visual web part. More info can be found here: http://msdn.microsoft.com/en-us/library/ff597539.aspx.