Skip to content
This repository has been archived by the owner on Jun 23, 2020. It is now read-only.

dnwhte/Umbraco.MultipleStartNodes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

65 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ADVISORY

Umbraco 7.7+ now support multiple start nodes. It is recommended that you upgrade to the latest version of Umbraco rather than relying on this package. Note: Umbraco 7.7+ does NOT yet support seperate start nodes for pickers. If that is a feature you would like please vote for it at http://issues.umbraco.org/issue/U4-10147.


Umbraco.MultipleStartNodes

This package gives you the ability to set multiple content/media start nodes for users.

##How it works

On the back-end the package relies heavily on Umbraco's Tree Events and ASP.NET's Delegating Handlers.

###Tree Events###

The TreeControllerBase.TreeNodesRendering event is used to replace the nodes that appear when the content/media tree is initially rendered. This is done by clearing the e.Nodes list, querying our custom table for the current user's start nodes, and adding them to e.Nodes.

The TreeControllerBase.MenuRendering event is used to remove admin functions (create, sort, republish) from the content/media root node as well as remove any context menu options in the config RemoveActionsForStartNodes from the user's start nodes.

###Delegating Handlers###

WebApiHandler captures a number UmbracoApi requests and modifies the result before returning it to the client.

####List of captured api requests and the actions taken####

/umbraco/backoffice/umbracoapi/content/getbyid
/umbraco/backoffice/umbracoapi/content/postsave
/umbraco/backoffice/umbracoapi/media/getbyid
/umbraco/backoffice/umbracoapi/media/postsave

Throw an http forbidden error if the user shouldn't have access to the node. Otherwise remove inaccessible ancestors from the node's path - this prevents the tree from reloading every time a node is requested.

/umbraco/backoffice/umbracoapi/entity/getancestors

Add a hidden=true value to AdditionalData on inaccessible ancestor nodes. Nodes with hidden=true are not displayed in the edit view's breadcrumbs.

/umbraco/backoffice/umbracoapi/entity/searchall
/umbraco/backoffice/umbracoapi/entity/search

Remove inaccessible content/media nodes from results.

/umbraco/backoffice/umbracoapi/media/getchildren
/umbraco/backoffice/umbracoapi/media/getchildfolders

Replace default start nodes with user's custom start nodes. Used by media pickers and the media section's ListView.

/umbraco/backoffice/umbracoapi/content/postmove
/umbraco/backoffice/umbracoapi/content/postcopy
/umbraco/backoffice/umbracoapi/media/postmove

Throw an error if the user doesn't have access to the location they're trying to move/copy a node into.

Remove inaccessible ancestors from the node's path - this prevents the tree from reloading every time a node is requested.


On the front-end a number of angular http interceptors are used to modify Umbraco angular views and occasionally add a custom controller.

views/components/editor/umb-breadcrumbs.html

Add an additional conditional that prevents inaccessible ancestors from displaying.

views/common/overlays/mediapicker/mediapicker.html
views/common/dialogs/mediaPicker.html

Disable the upload button, dropzone, and add folder button if the user is in a folder they do not have access to. Use angular to watch for a folder change and enable the features if the user has access. This should only apply when pickers are not being limited to the user's start nodes.

views/propertyeditors/listview/listview.html
views/propertyeditors/listview/layouts/list/list.html
views/propertyeditors/listview/layouts/grid/grid.html

Remove the move and delete functions from the user's start nodes. Disable the upload dropzone if the user does not have access to the folder.

views/content/move.html
views/content/copy.html
views/media/move.html
views/common/overlays/copy/copy.html
views/common/overlays/move/move.html

Add a value to the umb-tree customtreeparams attribute that lets the TreeControllerBase.TreeNodesRendering event know to render the user's custom start nodes instead of the default.

About

Adds the ability to have multiple content and media start nodes for Umbraco users.

Resources

License

Stars

Watchers

Forks

Packages

No packages published