Skip to content

Commit

Permalink
Allow non-staff to add and edit tickets
Browse files Browse the repository at this point in the history
  • Loading branch information
reswild committed Nov 21, 2023
1 parent 9f6e60a commit 8c3d0d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ export default {
setupComponent(attrs, component) {
const user = component.currentUser;
const enabled = this.siteSettings.tickets_enabled;
component.set('showTopicTicket', user.staff && enabled);
component.set('showTopicTicket', user.can_edit && enabled);

scheduleOnce('afterRender', () => {
$('.tickets-controls-container').parent().addClass('tickets-controls-container-outlet');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export default {
};

api.addTagsHtmlCallback((topic) => {
if (topic.is_ticket && topic.tags && currentUser && currentUser.staff) {
if (topic.is_ticket && topic.tags && currentUser && currentUser.can_edit) {
hideTicketTags();

const icon = siteSettings.tickets_icon;
Expand Down
2 changes: 1 addition & 1 deletion lib/tickets/guardian.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module TicketsGuardian
def can_create_ticket?(topic)
is_staff? && SiteSetting.tickets_enabled
can_perform_action_available_to_group_moderators?(topic) && SiteSetting.tickets_enabled
end
end

Expand Down

0 comments on commit 8c3d0d5

Please sign in to comment.