Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
[Feature request] Ability to hide workflow transitions in backend #3616
@markus-moser: Actually I did solve it using a guard, but what I came up with is pretty ugly. I require a certain role, something like:
...whereby the user does not belong to the ROLE_DATA_IMPORT. So far, so good - transition is hidden.
Problem now is: At some point the transition MUST be applied during the import, launched either via console command (where no permission system is present at all) or manually in the backend GUI, launched by the same user that does not belong to ROLE_DATA_IMPORT. In both cases I must create/inject a fake token in order to not throw an exception. This is why I said it is not permission issue. The user actually has permission to launch the import, which in turn applies the transition.
You solved this using guards - maybe you enlighten me at this point....? :-)
@gadget60 I had exactly the same situations. There are some different possibilities to solve it. I used a custom guard event subscriber instead of a guard expression. Then it's possible to disable the guard for the import process. Another way would be to check the subject attributes. For example if the importer sets an attribute "importedId" then it's possible to extend the expression with "or subject.importId != ''" or something like that.