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

[Tags] Add setting to allow discussion authors to edit tags #330

Closed
tobyzerner opened this issue Aug 29, 2015 · 4 comments
Closed

[Tags] Add setting to allow discussion authors to edit tags #330

tobyzerner opened this issue Aug 29, 2015 · 4 comments

Comments

@tobyzerner
Copy link
Contributor

From @tobscure on August 27, 2015 13:49

In the same way that the admin CP permissions page has a setting to let users rename their discussions "indefinitely", "for 10 minutes", or "until the next reply" – there should be a setting to let users edit their discussion's tags.

What needs to be done:

  • In the tags admin JS extension, extend the PermissionsGrid startItems method and add a ConfigDropdown, using core's "allowRenaming" item as an example.
  • Listen to the ModelAllow event and give the "tag" permission to users based on the setting, using the event listener defined in core's DiscussionsServiceProvider as an example.

Copied from original issue: flarum/tags#12

@tobyzerner tobyzerner changed the title Add setting to allow discussion authors to edit tags [Tags] Add setting to allow discussion authors to edit tags Aug 29, 2015
@tobyzerner tobyzerner mentioned this issue Aug 29, 2015
53 tasks
@dbohn
Copy link
Contributor

dbohn commented Nov 8, 2015

Hello,

my name is David and together with my fellow student Friedrich, we'd like to participate in the Flarum project.
It is a part of our university master course about processes in software design at "Freie Universität Berlin" to contribute to an open source project.
We are both really interested in the software as we were looking for good board software for quite a while now, and thus think that Flarum is an awesome project to contribute to.
We hereby want to present our solution strategy based on the above points and would ask for any things that we should consider as well.

  1. Create a new add*.js-file in the tag extension js/admin/src to store our modifications to the PermissionGrid.
  2. Add an item for editing the tags to the PermissionGrid similar to the item for renaming a post. The Dropdown can borrow the fields from the renaming item
  3. Alter tags' DiscussionPolicy and add a new event listener for the event that a discussion is changed. Is this the "DiscussionWillBeSaved"-Event?
  4. In the event listener, we check if the tags were changed and look if the user has the permissions. ($actor->hasPermissions)

We hope that the above steps will fix this issue.
If there is anything we have to consider, we would like to hear from you.
We are already familiar with the used coding style guide and will adhere to these.

Best wishes,

David and Friedrich

@franzliedke
Copy link
Contributor

Hello David, that's amazing, thanks for the offer! And greetings from Potsdam. =)

Yes, your plan of attack looks good. If you want to, you can open a pull request already, while you're making progress. That way, we can give you feedback even while you're still working on it.

Feel free to ask here if you encounter any problems.

And cheers again, thanks for the offer.

@dbohn
Copy link
Contributor

dbohn commented Nov 19, 2015

Hi,
I have a question. In the class "AddDiscussionTagsRelationship" there is a method "prepareApiAttributes". This method sets a field "canTag" in the DiscussionSerializer, which is used to display the "Edit Tags" button. The field is set as the actor's permission for 'tag'. But I cannot find, where this policy is defined. Can you give me a hint, where I have to look? I would alter this part to take the setting into account.

Thanks in advance!

@dbohn
Copy link
Contributor

dbohn commented Nov 19, 2015

I have an idea: Is this handled in Flarum\Tags\Access\DiscussionPolicy in the before method?

Edit: ok, it is there. Sorry for bothering!

tobyzerner added a commit to flarum/tags that referenced this issue Nov 29, 2015
realodix added a commit to realodix/flarum-ext-indonesian that referenced this issue Nov 30, 2015
@tobyzerner tobyzerner added this to the 0.1.0-beta.5 milestone Mar 11, 2016
askvortsov1 pushed a commit to flarum/tags that referenced this issue Mar 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants