Specify the context role to run a command with

runcon

  • Run a program in a different SELinux security context.
    With neither context nor command, print the current security context.
    More information: <https://www.gnu.org/software/coreutils/runcon>.
  • Trick copyright: tl;dr; <https://github.com/tldr-pages/tldr>

runcon -r {{role}}_r {{command}}

click the source code to copy install runcon on any operating system with command-not-found.com