83 Posts
squareweb
7 years ago
10
Topic

Hi,

I've created a list & search form. It shows only content of "logged-in" user. This is OK for front-end-editing so registered users can only edit their own articles.

Now I want the list to be showed containing ALL articles ONLY when a "superuser" logged in at the front-end. 

Front-end logged in == "superuser" ==> show all articles

Front-end logged in != "superuser" ==> show only logged-inn user articles.

Is this possible in one list & search form? Or do I have to create 2 separate search-forms (1 for "superusers" and 1 for registered users).

Thanks in advance

Mark

Get a VIP membership
4229 Posts
Kadministrator
7 years ago
2
Level 1

I you have only single frontent group you can use Access column to restrict your search field only to registered or whatever your normal viewlevel  is, if you need to specify it by group you can use restriction plugin

http://www.seblod.com/store/extensions/10872

83 Posts
squareweb
7 years ago
1
Level 2

Hi Klas,

Thanks for your reply. I've bought the plugin and installed. Can you hint me how to use it. Is it possible to model following:

Front-end logged in == "superuser" ==> show all articles (of one kind / type)

Front-end logged in != "superuser" ==> show only logged-inn user articles (of one kind / type).

Is it possible to combine search-variations like this to mimic if-else search.....

if (logged-in-usergroup == "superuser"){

show all

} else {

show only user-own articles

}

thanks in advance.

Mark

4229 Posts
Kadministrator
7 years ago
0
Level 3

This a restriction plugin (see manual bellow ). With it you can select usergroups for which this field will be shown or not, so in your case if you used "article author" field to show only current users articles. After you put usergroup restriction on field click on + - you can select superadministrators group and click on Reverse, this way article author filter will only be used for suers that are not in superadministrators group

4229 Posts
Kadministrator
7 years ago
1
Level 1

Hi,

first please see attached manual. With this plugin you can create restriction on a field to show only to user that bellong to some usergroup or Reverse - to show only for those that are not in some usergroup. 

So in your case if you used "article author" field to fitler articles so that user can only see his own articles you can use this restriction plugin and set it (click on + next to it) to superuser group and select Reverse (so that filtering field will NOT be used when user belongs to the superuser group)

83 Posts
squareweb
7 years ago
0
Level 2

Klas,

Thanks for taking time to explain. I've managed to show only the "articles" of the "owner" by filtering on authorID (Article created by"-field.

As soon as I add your restriction-option (see screenshots). The whole list is visible instead of only the "article" of the owner....

Did I implement your idea right?

Thanks again.

Mark

4229 Posts
Kadministrator
7 years ago
2
Level 1

"The whole list is visible instead of only the "article" of the owner...."

Yes, this is exactly what should happen if you are logged in as superadmin (for other users it should stay the same as it was), I thougt this is what you want?. 

If this is not what is happening, try setting Reverse to No.

83 Posts
squareweb
7 years ago
1
Level 2

Klas, indeed this does work, thanks for that (:-. However if I change permission-settings of the search-list from "public" to whatever "super user" or "registered", front-end search list is not accessible but error is thrown: "not allowed to access this resource." If setting is: "Public" it works fine... Is this expected behaviour?

Furthermore: I'd like to use (show) this search form only after (front-end) login. If I'm correct I've to create 2 menu-entries pointing to the same search-list-form? One for each usergroup-type? is this correct?

Sorry for bothering, probably my second question is off topic here.

Thanks in advance.

Mark

4229 Posts
Kadministrator
7 years ago
0
Level 3

Yes, this is expected. Leave content type permission set to Public.

What you need to set is Access column of the fields (see your first screenshot in this thread), this way you set access to each field and since you can show different fields to public that to e.g. superusers

4229 Posts
Kadministrator
7 years ago
1
Level 1

"The whole list is visible instead of only the "article" of the owner...."

Yes this is exactly what should happen if you are logged in as superadministrator. other users should only get their own articles. If this is not what is happening change Reverse to No.

83 Posts
squareweb
7 years ago
0
Level 2

Thanks a lot Klas for helping me out here. Now I can use this approach for my application, this was crucial information.

Regards

Get a Book for SEBLOD