Problem/Motivation
On the Workflow configuration pages 'tranitions' and 'access', there is no anonymous Role in the Table, only (author) and the Roles described above.
Proposed resolution
After digging around in the Code I found in workflow/modules/workflow_access/src/Form/WorkflowAccessRoleForm:70 the call to workflow_get_user_role_names("create $type_id workflow_transition"), which on the one hand looks wrong (why are you querying for users that can create a transition, when all we want is to view the Content, or am I getting anything wrong here?) and on the other hand calls workflow_get_user_role_names which calls user_role_names(TRUE, $permission));, where TRUE means "no anonymous role", right?
>> Indeed, the boolean must be set tot FALSE.
Original report by [username]
I Have a Site with the Workflow Module using Workflow Access and a Workflow called Content Creation which is used for multiple Content Types.
Furthermore the Site has multiple Roles (Employee, Moderator, Publisher) and the Workflow has multiple Steps (Draft, Checking, Waiting for publishing, Published).
Content should only be viewable by anonymous Users when the Status is "Published".
If I understand Workflow Access right, I would need to set "Roles who can view posts in this state" for anonymous for the Status?
The Problem is, there is no anonymous Role in the Table, only (author) and the Roles described above.
Also the anonymous Role has the right to participate in the Content Creation workflow.
After digging around in the Code I found in workflow/modules/workflow_access/src/Form/WorkflowAccessRoleForm:70 the call to workflow_get_user_role_names("create $type_id workflow_transition"), which on the one hand looks wrong (why are you querying for users that can create a transition, when all we want is to view the Content, or am I getting anything wrong here?) and on the other hand calls workflow_get_user_role_names which calls user_role_names(TRUE, $permission));, where TRUE means "no anonymous role", right?
Am i doing something wrong or is it not possible to give view rights to anonymous users (I think I'm doing something wrong because this would be weird, yes?)
I already deinstalled and reinstalled the workflow module with no luck and spent a lot of time trying to figure this out, so I really think I need help.
Thanks, Alex.
Comments
Comment #2
johnvFirst of all, happy new year, Alex . I am glad workflow is on top of your mind on the first day of the new year. ;-)
From my memory: I guess you are right, anonymous user should be incorporated, so switching the boolean should help. The permission 'create transition' is the technical name for ''participate in workflows". It is mainly used to keep the list of roles in Workflow Admin UI manageable. So you should give Anonymous this permission. It will appear in your list on Transition roles and Workflow access.
Beware: if a role already has a permission with default permissions, you won t see any effect.
Hope this helps. If not , i ll hear from you again.
Comment #3
Miradorn commentedHappy new year to you too!
So to my understanding the method
workflow_get_user_role_nameswould have to be patched, to take a second parameter, which defaults to true and would be passed through to theuser_role_namescall.Should I open up a pull request for this change or will somebody else look into this?
Thanks again for your time!
Comment #4
johnvIt is sufficient to change the here:
The Anonymous role was lost in the 'transition roles' page, too.
I'll fix this shortly.
Comment #5
johnvYou will need to add the Anonymous/Guest role to the list via the permissions page.