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

Queues only get CustomRoles that apply to tickets #398

Open
wants to merge 1 commit into
base: 5.0-trunk
Choose a base branch
from

Conversation

btb
Copy link
Contributor

@btb btb commented Feb 10, 2025

/Admin/Queues/CustomRoles.html currently always shows all custom roles regardless of whether they apply to tickets or not, even showing them as applied, if they are applied to another object type (i.e. asset catalog) which has the same id.

I followed the lead of other code dealing with CustomRoles, and (ab?)used the CustomFieldLookupType method to get the applicable LookupType.

This hard-codes EditCustomRoles to only work for administering queues, but that's all it's currently used for anyway.

This limits the EditCustomRoles element to only showing ticket
custom roles, but it's currently only used for queues anyway.
@cbrandtbuffalo
Copy link
Member

Hi @btb , thanks for the PR! Since custom roles can be applied to assets, I extended your PR to cover catalogs also. Could you check and see if this branch works for you? https://github.com/bestpractical/rt/tree/5.0/queue-custom-roles

@btb
Copy link
Contributor Author

btb commented Feb 13, 2025

That works great as well. I do really appreciate having more consistency between tickets and asses.

Speaking of which, back when I used and worked on the AssetTracker plugin, we had scrips for assets, and I liked it a great deal - I just started figuring out what would be needed to do that with RT's Assets, without adding more tables like AT did. It would probably be just as useful, or maybe more, for Articles - I know some folks were asking for something like post-edit actions on those.

So far it's not really been that difficult - give RT::Scrip the "RT::LookupType" role (one new column for LookupType), and let RT::Templates belong to other objects besides Queues (one new column for ObjectType), and then it kinda writes itself. I'm thinking of starting a pull request for this, I'd be happy to get feedback, if you think it would be welcomed. I wouldn't have any expectation of it being a quick turnaround of course.

@cbrandtbuffalo
Copy link
Member

Yes, we definitely want to add scrips to assets, we just haven't gotten there yet. If you want to work on a PR, that would be great.

@btb
Copy link
Contributor Author

btb commented Feb 26, 2025

Yes, we definitely want to add scrips to assets, we just haven't gotten there yet. If you want to work on a PR, that would be great.

My work is now up at #399

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

Successfully merging this pull request may close these issues.

2 participants