Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Orchard CMS - Can Permissions Be Set for a Single Content Item Instance Such as a Custom Form

In Orchard CMS I know that permissions can be set for content types. What is the suggested way to set permissions on single instances of content items. In particular, I would like to use the custom forms module to create multiple custom forms where some are only available to authenticated users while others are available to anonymous users. I am fine with creating a custom module for this but would like to have at least a general idea of what would is involved with building more granular permissions at the content item level. Thanks.

like image 767
bingles Avatar asked Feb 17 '14 13:02

bingles


People also ask

How do I implement custom permissions in Orchard?

Custom permissions are implemented in a permissions.cs file. In this file we'll implement the IPermissionProvider interface. The definition is a 3 step process, define the permission, return a list of Permissions used in the Module, and the last step is to map the permissions to the build in roles in Orchard.

Does Orchard support state-based permissions for workflow actions?

@sebastienros Orchard 1 - User Task Workflow which was linked by @bakintunde demonstrates creating buttons for users to trigger workflow actions, but doesn't touch on state-based permissions. Orchard implements an activity-based workflow system (which is basically visual scripting to automate actions in the CMS). (Which is awesome and works great.)

Does user/group/role/permission work independently of content type definitions?

User/group/role/permission does not work independently of content type definitions even now. Once a content type is created, OC implicitly provides built-in CRUD type permissions for it that can be assigned to roles. The proposal is to somehow extend that permissions system so we can limit certain permissions to certain users.

Can users be assigned to groups in Orchard?

I'd rather just add users to groups manually or via a registration workflow (in the current Orchard sense) that picks the right group. Yes, users would be assigned to groups. A group would contain users or groups. The registration workflow you linked to is for legacy Orchard, not Orchard Core (OC).


1 Answers

I was never really able to find any detailed documentation on this so here is a summary of what is involved:

1) Under "Modules" section Enable "Content Item Permissions" feature

Enable Content Item Permissions Feature

2) Under "Content Definition" find the content type you want to add permissions to and click "Edit"

enter image description here

3) Attach the "Content Permissions" part to your content type

Content Permissions Part

4) After adding the part you can manage the permission settings

enter image description here

like image 67
bingles Avatar answered Sep 27 '22 16:09

bingles