Project

General

Profile

Actions

Bug #33340

closed

Creating a Job via an user with selective permissions will not show "Job template" in the form unless refreshing the result of Search Query

Added by Adam Ruzicka over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1993679

Description of problem:

The idea here is to ensure that an user should only be able to see one Ansible Playbook and run it on hosts.

So we created a role with custom permissions and then assigned to a user.

Creating a Job via that user will not show "Job template" field in the form unless refreshing the result of Search Query, using that refresh button.

Version-Release number of selected component (if applicable):

Satellite 6.10 [ as well as Satellite 6.9 ]

How reproducible:

Always

Steps to Reproduce:

1. Create a small Ansible Playbook based job template called "Testing" with the following content. ##
---
- name: Test Play
hosts: all
gather_facts: false
tasks: ##

- name: Check current user
command: whoami
register: def_user
- debug: var=def_user.stdout

2. Create a role called REX, a user called rexuser with password set as password@123 using the rex_role_create.sh script

3. Go to Administer --> Users --> and Impersonate the rexuser user.

4. Now go to Hosts --> All Hosts --> Select one host using checkbox --> From Select Action dropdown click on "Schedule Remote Task"

Actual results:

  • It will take us to the "Job Invocation" Page and we could see the following data.

Job category: Ansible Playbook

Bookmark: <Blank>

Search Query: name ^ (host.example.com)

Resolves to button

Type of query

Schedule

But the "Job template " dropdown is completely missing.

So now, if we hit the refresh button just beside "Resolves to ", the "Job template" option suddenly comes out and It has the "Testing" playbook selected as expected.

Expected results:

We should not need to do the last step to see the "Job template " dropdown. It should show up automatically.

Additional info:

  • The role actually looks like the following.

----|--------------------|------------------------------------------------------|------------|-----------|------|-------------------------------------------------------
ID | RESOURCE TYPE | SEARCH | UNLIMITED? | OVERRIDE? | ROLE | PERMISSIONS
----|--------------------|------------------------------------------------------|------------|-----------|------|-------------------------------------------------------
335 | Organization | none | yes | no | REX | view_organizations
336 | Location | none | yes | no | REX | view_locations
337 | Host | none | yes | no | REX | view_hosts
338 | SmartProxy | none | yes | no | REX | view_smart_proxies
339 | TemplateInvocation | job_category = "Ansible Playbook" | no | no | REX | view_template_invocations, create_template_invocations
340 | JobTemplate | job_category = "Ansible Playbook" and name = Testing | no | no | REX | view_job_templates
341 | JobInvocation | job_category = "Ansible Playbook" | no | no | REX | create_job_invocations, view_job_invocations
----|--------------------|------------------------------------------------------|------------|-----------|------|-------------------------------------------------------

and It is being suspected that one of these three resource_types is creating an issue here i.e. TemplateInvocation \ JobTemplate \ JobInvocation. It's either a misconfiguration or a bug or expected behavior.

  • Also We are trying to find out the relation between, "TemplateInvocation" "JobTemplate" and "JobInvocation" as all three of them gives us common search options to filter "Job Category"

Related issues 1 (0 open1 closed)

Has duplicate Foreman Remote Execution - Bug #31511: Job templates permission filter makes template dropdown disappearDuplicateActions
Actions #1

Updated by The Foreman Bot over 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman_remote_execution/pull/647 added
Actions #2

Updated by Adam Ruzicka over 2 years ago

  • Status changed from Ready For Testing to Closed
Actions #3

Updated by Adam Ruzicka over 2 years ago

  • Fixed in Releases foreman_remote_execution-4.5.6 added
Actions #4

Updated by Adam Ruzicka over 2 years ago

  • Has duplicate Bug #31511: Job templates permission filter makes template dropdown disappear added
Actions #5

Updated by Adam Ruzicka over 2 years ago

  • Fixed in Releases foreman_remote_execution-4.8.0 added
Actions

Also available in: Atom PDF