57 Posts
SemaphoreOxalis
3 years ago
4
Topic

Hi,

We think it will be easy buuuuut we are not able to prevent a usergroup to change the state of an item from frontend. By default the state of publishing is 0 (unpublished)

We have tried to put some restrictions on the art_state field but when the user group who can't have access to the art_state create a new item, the nex item is now published by default.

What is the best way to prevent a user group from publushing.

thanks

Get a Book for SEBLOD
119 Posts
root
3 years ago
3
Level 1

Hi,

Yes, very easy. The usergroup must have access to the field art_state, you can hide that field in the form so they can't change the value. Since many Seblod versions ago, theoretically it is not possible to change the value of a hidden and protected field.

57 Posts
SemaphoreOxalis
3 years ago
2
Level 2

Thanks for your help but we can't definitly hide the art_state because other groups need it ;-)

119 Posts
root
3 years ago
1
Level 3

Well, there are different ways depending on your needs. Is that content type based on a Joomla article? If yes, you can change the permissions of the article manager. Options / Permissions / Select the group and change the "edit state" permission.

Also you can add 2 art_state fields with identical configuration (different aliases of course) and different permissions and conditions. With a Seblod Field restriction or with an SQL query restriction. The goal here is to never load the 2 fields at the same time. Maybe with a workflow restriction if you need to change the state only on edit, an so on...

Best regards.

57 Posts
SemaphoreOxalis
3 years ago
0
Level 4

Finally we have use another trick : we have user a phpfield for getting the usergroups an echo it as class and put a display none on the publishing fields.

Get a VIP membership