A A A

Please consider registering
guest

Log In Register

Register | Lost password?
Advanced Search:

— Forum Scope —



— Match —



— Forum Options —




Wildcard usage:
*  matches any number of characters    %  matches exactly one character

Minimum search word length is 4 characters - maximum search word length is 84 characters

Topic RSS Related Topics
How to get the users with a specific permission in a specific forum?
Apr 26, 2010
11:50 am
Rookie
Forum Posts: 5
Member Since:
Apr 22, 2010
Offline

Can someone pioint me to the easiest wey to find all the users that have a specific permission in a specific forum  (for example that have the "can subscribe" permission knowing only the forum ID?

If I got the SImplePress DB structure it's look like the following:

1. in sf_roles table looks for roles that have the "can subscribe" option turned on (what identify an option on or off?). Then returns the roles id

2. in sf_permissions looks for permission_role = one of the roles_id we got in (1) and forum_id = the form id we got from the beginning. Returns usergroups_id

3. in sf_membership looks for usergroup_id = one of the usergroups_id we got in(2). Returns the list of users_id

 

Is the right procedure?

Does exists some SF function that "wrap" any of these steps or part of it?

 

If you do want to know the whole story (i.e. "why do you want to do that) here it is:

We need to notify via email all the users "enrolled" in a specific private forum (aroun 15/20 people) when one of our editors publish a blogpost linked to the forum.

So we added some code to sf_publish_blog_link() function to send that email…

…but we need to know the users email … we choose to notify only the users taht have "can_subscribe" permission…

But my knowledge of SimplePress is limited so I'm asking your help…

Thanks!

 

Stefano

P.S.

We are stuck in the 4.1.3 version… no options to upgrade.

 

Apr 26, 2010
9:40 pm

SP Master
Forum Posts: 23688
Member Since:
Dec 10, 2006
Offline

your three step procedure is correct, I believe… havent ever tried that and no, we dont have a function for such information…

Forum Timezone: America/Chicago

Most Users Ever Online: 444

Currently Online: SPQC, joelrob
56 Guest(s)

Currently Browsing this Page:
1 Guest(s)

See All Online Activity

Top Posters:

-Radio-: 1251

Lee H: 606

Luffer: 535

Conrad_Farlow: 502

jim: 478

neon: 263

ovizii: 240

Tal: 240

Member Stats:

Guest Posters: 2626

Members: 7363

Moderators: 1

Admins: 2

Forum Stats:

Groups: 5

Forums: 16

Topics: 10898

Posts: 79583

Moderators: Brandon C (162)

Administrators: Yellow Swordfish (22240), Mr Papa (23688)