2

Recently I started working on Orchard CMS. I am able to create a layer with "Layer Rule" like "not url '~/some-page-url'". What my question is "is it possible to combine Layer Rule with User Role. I tried like this 'authenticated(admin)' but it is not working as i expected.

What i did: Created a simple page with title "Test Page" and created a Navigation say "Only Admin". In Widget page i choose "Authenticated Layer" and "edit" in layer rule, i changed "authenticated" to "authenticated(admin)".

Expected: Only when ever admin login the menu which i ve created is to be shown in the front end. and none other user login menu has to be hide.

"Im in the correct way or not can some one guide me in the right path." PS:Sorry for my english.

UiUx
  • 967
  • 2
  • 14
  • 25

2 Answers2

2

This functionality is not supported out of the box but there is a module on the gallery that offers it:

Role Layer Rule

Hazza
  • 6,441
  • 3
  • 24
  • 37
  • Hi @Hazza, Thanks for your reply. Role "Administrator" - rule is not showing any thing...? – UiUx Jan 30 '15 at 12:16
  • only for administrator is not working and remaining all like: Editor, Moderator, Author, and Contributor is working fine. – UiUx Jan 30 '15 at 12:34
  • Yeah..! for administrator also it is working. i dint given email id to administrator. – UiUx Jan 30 '15 at 12:38
  • Ah, yes that catches me out sometimes, administrators lack of email. Glad to hear you got it working :) – Hazza Jan 30 '15 at 16:12
0

This rule now exists in Orchard core since v1.10.

It was casually added in as a conversion of features in the old rules engine and not even the main developers remembered it was in there haha.

rtpHarry
  • 13,019
  • 4
  • 43
  • 64