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
tobscure opened this Issue Aug 29, 2015 · 4 comments

Comments

Projects
None yet
3 participants
@tobscure
Member

tobscure commented Aug 29, 2015

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

@tobscure tobscure changed the title from Add setting to allow discussion authors to edit tags to [Tags] Add setting to allow discussion authors to edit tags Aug 29, 2015

@tobscure tobscure referenced this issue Aug 29, 2015

Closed

v0.1.0 roadmap (old) #74

19 of 53 tasks complete

@justjavac justjavac referenced this issue Sep 7, 2015

Open

Flarum v0.1.0 开发路线图 #3

18 of 53 tasks complete
@dbohn

This comment has been minimized.

Show comment
Hide comment
@dbohn

dbohn 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

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

This comment has been minimized.

Show comment
Hide comment
@franzliedke

franzliedke Nov 9, 2015

Member

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.

Member

franzliedke commented Nov 9, 2015

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

This comment has been minimized.

Show comment
Hide comment
@dbohn

dbohn 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 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

This comment has been minimized.

Show comment
Hide comment
@dbohn

dbohn 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!

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!

tobscure added a commit to flarum/flarum-ext-tags that referenced this issue Nov 29, 2015

realodix added a commit to realodix/flarum-ext-indonesian that referenced this issue Nov 30, 2015

@tobscure tobscure added this to the 0.1.0-beta.5 milestone Mar 11, 2016

@tobscure tobscure closed this Mar 11, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment