OrchardCMS / OrchardCore

Orchard Core is an open-source modular and multi-tenant application framework built with ASP.NET Core, and a content management system (CMS) built on top of that framework.
https://orchardcore.net
BSD 3-Clause "New" or "Revised" License
7.35k stars 2.37k forks source link

Permission for specific pages (content item permissions) #5925

Open adelemam opened 4 years ago

adelemam commented 4 years ago

I need some specific content items to have permission at front user, so only user with permision can login to site and access it , Public user shouldn't have access to it ,

How can I do this?

Piedone commented 4 years ago

Great timing, I just wanted to open such an issue :).

This is not yet possible in Orchard easily in a built-in way. You can configure permissions per content type, so you'd need to add new content types for those pages (even like copying the content definition of Page) and grant permissions for them to specific roles.

However, as we've just discussed under https://github.com/OrchardCMS/OrchardCore/issues/1091 (note, that while the issue's title says content item permissions it's actually about content type permissions) this was possible in Orchard 1 and the Etch.OrchardCore.ContentPermissions module does just that.

In the short term, you can use that module. On the longer-term let's discuss incorporating it into Orchard, as permitted by @peterkeating.

Piedone commented 4 years ago

Related: https://github.com/OrchardCMS/OrchardCore/issues/4040

sebastienros commented 4 years ago

I'd rather keep it outside of the core modules. The implications can be huge.

adelemam commented 4 years ago

when do you think it can be released, it is a major feature i guess

Piedone commented 4 years ago

What would be the implications? :) It was very useful in O1.

Brendan-csel commented 3 years ago

Hi folks and thanks for all your work on this project. We've going to use it to replace an old DNN website for a client.

This is one corner where I think our client is going to struggle a bit so just thought I'd add the use-case here for comparison.

In DNN role-based permissions (view and edit) can be set for pages. By default the page-level permissions are inherited by "modules" of content on the page - ie child Content Items - but these child items can also have more restrictive permissions.

If a user doesn't have a role with view permissions...

  1. Attempts to access a page will be redirected to the login page.
  2. In-page content will be suppressed if they have more restricted permissions than the page.
  3. Menu items linking to the page are automatically suppressed.
  4. Search results are automatically suppressed for content items the user doesn't have view permissions for.

With Orchard OOTB I think I understand we'll need to define content types specific to each role...

Then the client will manually need to ensure the the relevant page and menu items are created from the appropriate content types above.

I'm hoping those content type permissions will automatically be reflected in search results -otherwise I assume we'll need to create separate search indexes per role too?

Any corrections to my assumptions above (or links to options) would be appreciated otherwise (based on @sebastienros comment above) it sounds safer to stick with this standard approach using content type permissions.

JoshTango commented 1 year ago

I opened a new one #13002 Its about collaboration apps. Its a very important feature.