Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Policy's Self Service Category able to be removed from Self Service Categories #51

Open
cybertunnel opened this issue Apr 8, 2020 · 1 comment

Comments

@cybertunnel
Copy link
Contributor

Found this bug where a self_service_category can have it's display_in to false but if it is in the array, it will default to true anyways when posted to the API.

Example:

  • I run the command: policy.add_self_service_category 'Testing', display_in: false
  • Validate the results are correct: policy.self_service_categories which results to `[{:id=>18, :name=>"Testing", :display_in=>false, :feature_in=>false}]
  • However, when I pull from the API again, and run policy.self_service_categories which results to `[{:id=>18, :name=>"Testing", :display_in=>true, :feature_in=>false}]

Suggested fixes:

  • If display_in is set to false, throw and error
  • if display_in is set to false, remove from self_service_categories
  • Force display_in to be set to true, push user to use policy.remove_self_service_category(cat) to remove categories
@cybertunnel cybertunnel changed the title Self Service Categories Able to Set :display_in to false Policy's Self Service Category able to be removed from Self Service Categories Apr 8, 2020
@cybertunnel
Copy link
Contributor Author

Turns out the above issue was around my error. However, this did bring to light a bug where ruby-jss allows me to remove the category the policy is assigned.
This violates Jamf's Self Service functions of categories since a policy's category has the policy always displayed in Self Service under that category.

Suggested fix:
Throw an error when user attempts to remove the category the policy/object is assigned to using the policy.remove_self_service_category

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant