permissions for privatemsg_filter need to be improved.

nbz - February 2, 2009 - 02:45
Project:Privatemsg
Version:6.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:closed
Description

Two things:

1. There is no permission to now allow users to filter by users - this seems to be available to all.
2. "create privatemsg_filter" seems to be a bad permission name. "create privatemsg_filter tags" would IMO be a better idea. Would this also need an update function to replace all the original permissions from whereever it is stored to the new one? is it worth the "pain"?

#1

nbz - February 2, 2009 - 02:58
Status:active» needs review

actually there is a permission for number 1, but it is not used. attached patch fixes that.

EDIT - a word of note - the number 2 from the above also applies to the delete permission. Both would read better if they had " tags" at the end of the permission names.

AttachmentSize
privatemsg_filter.permissions.patch 1.05 KB

#2

Berdir - February 2, 2009 - 22:08

litwol and I talked about tags per user in IRC. If this is going to happen, we need to change/extend the permissions anyway.

#3

nbz - February 20, 2009 - 23:30
AttachmentSize
privatemsg_filter_permission.patch 1.06 KB

#4

Berdir - February 20, 2009 - 23:33
Status:needs review» reviewed & tested by the community

Looks good now :)

#5

nbz - February 20, 2009 - 23:49
AttachmentSize
privatemsg_filter.patch 1.6 KB

#6

nbz - February 20, 2009 - 23:49
Status:reviewed & tested by the community» needs review

Added a tag count check before adding the tag select form.

#7

Liam McDermott - March 1, 2009 - 21:40
Status:needs review» reviewed & tested by the community

Just to clarify exactly what this patch does:

  1. Fixes bug where Privatemsg_filter ignores the 'use privatemsg_filter' permission;
  2. Only adds the tag selection form (beneath a message thread) if there are any tags available;

I've successfully applied the patch and tested both fixes. It works marvellously and is ready to be committed. :)

#8

litwol - March 5, 2009 - 16:48

This line in the conditional statement for privatemsg_filter_privatemsg_view_messages_alter assumes that tags are sitewide. Should i assume this will be patched once we commit the tags-per-user patch?

db_result(db_query('SELECT COUNT(*) FROM {pm_tags}'))

#9

Berdir - March 5, 2009 - 17:08

The patch, in its current form, creates a new privatemsg_tag module, which is afaik a complete rewrite, so it will need to be patched anyway. But it might take some time until that is ready, while this is just a small fix to the current module.

#10

litwol - March 5, 2009 - 18:09
Status:reviewed & tested by the community» fixed

homerun.

#11

System Message - March 19, 2009 - 18:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.