UBB.Dev
Posted By: sirdude [7.2.1] - Expanded group permissions - 08/22/2007 2:24 AM
Couldn't wait til 7.3, because a customer needed it and had a spare afternoon.. So this puppy was born to bridge the time gap.

It allows an Admin to selectively dole out permissions based upon with group or groups they are in..

It not only looks at whether the group feature is enabled or disabled, but additionally takes into account an optional post count requirement for each feature.

Features only come into play, if the board allows the feature globally or on a per forum basis.

Features can be or'ed together, much like we have now for forum based group permissions.

Group features also utilize the same type of permission caching that Rick employed for Forums. It's very efficient that way.

I believe a picture or pictures is worth a 1003 words, so here goes some screenies..

select

[Linked Image]

then

[Linked Image]

and voila

[Linked Image]

You'll notice that i pulled the custom title per group feature over into THIS matrix, so don't be alarmed if you click on the other tab and notice it's 'missing'.. It just moved over to it's newfound home smile

I belive the last screenie is self explanatory..

Feel free to ask questions..

Oh and backup your files etc etc, before doing this puppy. It's a medium to hard modification..

and read the ReadMe.txt for all the dirty rotten details that i didn't cover here as well as what to actually do if you want this on your board..




Description: Take a wild guess..
Attached File
ReadMe.txt  (25 downloads)
Posted By: Gizmo Re: [7.2.1] - Group feature permission matrix - 08/22/2007 2:31 AM
Lookin good
Wouldn't download for some reason - now it does laugh

Looks awful cool- even if it's only 943 lines eek I may try to adapt the old auto-hack app for threads. smile
hmm... only 10 steps, that isn't bad afterall - thanks for the mod, looks to be real nice smile
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/22/2007 6:19 AM
i think it's 12 !

you need to re-download the new Readme.txt.. i forgot a very important one in there..

namely modifying the user class in ubbthreads.inc.php for cached group feature permissions!

Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/22/2007 6:21 AM
Originally Posted by AllenAyres
I may try to adapt the old auto-hack app for threads. smile


i'd love to know more about this!

if there is a more automated way of applying hacks/mods/patches.. i would be willing to adapt it, if need be smile
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/22/2007 6:28 AM
bleh.. 1 more upload. the SQL syntax was sn00kered frown
Originally Posted by sirdude
Originally Posted by AllenAyres
I may try to adapt the old auto-hack app for threads. smile


i'd love to know more about this!

if there is a more automated way of applying hacks/mods/patches.. i would be willing to adapt it, if need be smile


I can't even remember the name of it right now, I was the king of using it tho... since I applied mods for customers I might have to add one mod 15 times, so it paid off in time saved many times over and I didn't make any mistakes once it worked the first time smile

Ahh, here it is: https://www.ubbdev.com/db/ultimatebb.php/forum/22.html

Multihack - Troy wrote it and I wore callouses in it. smile
oh, this mod will come in very handy for a friend's site. He's stuck on 6.5 because of the mods he has in place smile
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/22/2007 7:04 AM
cool ! wink

btw, i've already had a couple queries on what the 'self explanatory' picture was.. which means it wasn't VERY SELF explanatory after all laugh

soo.. let's start with the picture:

[Linked Image]

Let's take the Cusom Title column. It's saying that all groups are allowed custom titles (check boxes checked).. but the Users group need to get to 200 posts before their's becomes enabled..

Now onto Search.. This enables the groups to use the 'Search' button or Menu option. Where you go to advanced, if desired etc etc.. It does NOT limit show user posts and the like. (for now).. Anyway, once again only the Users group must have a post count (40) before they can search..

Avatar is a little different.. but only slightly.. Here the board configuration must first allow avatars in the first place. If that is done, then these group features kick in to further filter by appropriate groups.

PMs are even a little more different. We currently have the ability to turn off PM per USER.. so if that's turned off, they won't be able to PM period.. but if it's on for the user and they fall into say the Users group, then they can start PMing @ 40 posts..

Can upload. This applies to attachments. So if a forum FIRST allows attachments at all, then these group permissions go further to filter by group...

As you can see, it's quite flexible already..

There is of course a wish list and i don't see why it can't be expanded upon.. eg:

  • Images in Sigs
  • longer Edit post time
  • longer Delete post time
  • longer back in time search
  • larger upload filesizes
  • Can start a Poll
  • avatars can be broken down into:
    • can link remote
    • can use stock
    • can upload
  • and so on and so on


reason this got born real quick, was there was a short term need for it.

note: if a member is part of mutiple groups, the Least common denominator to enable wins. ie: if one group requires 10 posts and another group requires 1000 posts.. and a user is part of both groups with 100 posts.. they will get enabled, because of the 10 post group...

get the drift?
Posted By: Gizmo Re: [7.2.1] - Group feature permission matrix - 08/22/2007 7:10 AM
I tried to have a VBasic programmer friend of mine look at an auto hack program, but he's a student and we didn't get very far...
The mod is very nice SD, this will be muy helpful thumbsup
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/22/2007 7:38 AM
Thanks Allen.. my afternoon off served well then..

btw, i have this running on two Victim's beta sites.. as well as on 2 of my own 'bleeding edge' sites just for development.

all seem to work fine smile

well, the bleeding edge ones are a little shaky, because i have a ton of ajax (yui) code flying around right now.. but that's separate from this modification..
Posted By: Ian_W Re: [7.2.1] - Group feature permission matrix - 08/22/2007 12:49 PM
Many thanks for this. smile

Posted By: Ian_W Re: [7.2.1] - Group feature permission matrix - 08/22/2007 12:53 PM
I have yet to read the directions, but will it give an appropriate error if say (given your example) a new user tries to PM before they have made 5 posts.

If not it would be nice if an error said ' Sorry, but your post count is not yet high enough to send PM's - receiving PM's in unaffected. '

Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/22/2007 1:34 PM
well, the error is in the language file and it's more generic. ie: it doesn't distinguish between the checkbox and the post count..

they are taken as a combo bombo enable.. if checked AND postcount then bada bing... else bummer..

sooooo, you could edit the lang file to say..

"dude, either sending pm's are totally disabled for your sorry arse or you need some more posties.. either way, you're shut down (for now)"

:2c:
Posted By: Gizmo Re: [7.2.1] - Group feature permission matrix - 08/22/2007 5:59 PM
Rofl, i love that error message wink...

Though it could be a great spam prevention; forcing users to have say 25 posts before sending messages, at least you'd be protecting yourself from drive-by spammers...
Wondering, will this cause issues when we get to 7.3?
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/23/2007 7:14 AM
well, it definitely could because i have no idea how far Rick intends to go or what his way of implementation is..

i chose the most logical means of expanding group features that i saw.. i liked the way he cached forum permissions, so i fit in group features the same way.

oh and i only had 1 afternoon/evening (late one) to slap the code together too laugh

he may be thinking something different and on a more grand scale..

example would be that i created a totally NEW table for the group feature cache.. well.. maybe we wanted to just add a field for the serialized features per user in the ubbt_CACHED_PERMISSIONS table instead..

and there maybe more things we want to add in the way of group features such as:

  • group can use [img] in posts
  • group can have [img] in sig
  • configurable edit time per group
  • configureable delete time per group
  • group can toggle html markup
  • ability to ignore users
  • use of special tags.. ie: [yahoovideo]..
  • group can have more characters in their sig
  • group can upload sigs to a storage area on server (ala avatars)
  • group can create polls
  • group can conquer the world! (i joke) laugh
  • and on and on...


so although i'd love to be privvy to what's in Rick's brain, as there is some neat stuff rollin' around.. i can't.. sooo

Rick will be the best one to answer that...
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/23/2007 7:43 AM
lol, i just realized i reproduced the wish list that i had typed in last nite...

dunno how similar they are, but you get the drift smile

just OR the two lists to come up with master 'wish list' wink
Posted By: Ian_W Re: [7.2.1] - Group feature permission matrix - 08/23/2007 10:47 AM
Regarding groups, I am hoping that at some point we can also restrict adds to a non-paying group smile

Or have three levels of ads.

1) Guests get all the standard ads and also an extra one or three in a thread

2) Members get standard ads and perhaps just one in a thread

3) Contributing members get no adverts.

I think this would encourage more people to contribute towards the running of a site.
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/23/2007 3:46 PM
well, with multiple groups, you can have N-levels actually with this scheme in place..

so i wouldn't see that as a problem.
I think with the content island displaying the ad it would be simple enough to do an if/then for group membership at the top to show/hide the content island smile
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/23/2007 9:50 PM
agreed allen.

with the hard part really being the admin interface as well as the cached db interface.. the checks in the code are very simple..

example to check for if a user has PM capability from the permission matrix they would do:

PHP Code

if ($userob->group_features['pm']) {
echo
'yeppers, this dude has pm rights';
} else {
echo
'neener neener.. no can do';
}


the only difference between checking for other group features is just a simple matter of replacing 'pm' with 'avatar' or 'search' or.......

you get the idea smile
Posted By: Rose Re: [7.2.1] - Group feature permission matrix - 08/28/2007 5:27 AM
Well done, SD! I like this mod. smile So would it be possible to add something like, "Member is in private moderation"? That would be cool. I also like your "rule the world" idea. laugh
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/28/2007 5:56 AM
although this mod might be 'great', i'd not suggest using it if you intend to go to 7.3.

this was only a temporary one for a customer who couldn't wait.

7.3 should have this kinda functionality and more a part of STOCK.

it was a kind of quickie brain dump on a friday afternoon/evening kinda thing..

just 2c
I like it a lot - I wonder how close it would be to the stuff in 7.3?
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/29/2007 5:07 AM
i'd expect 7.3 to be more expansive, from what i have gleaned..
Posted By: Gizmo Re: [7.2.1] - Group feature permission matrix - 08/29/2007 7:53 AM
yeh, I think Rick wants to appease all of us permission monkeys so we stop whining about global moderators and payment methodized groups...
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/29/2007 9:05 AM
..er i'm not whining about it... so this 'we' thing... must be other peeps.. wink
Posted By: Gizmo Re: [7.2.1] - Group feature permission matrix - 08/29/2007 10:05 AM
Hey, I stopped whining some time ago; you know, when he mentioned he was planning to work on the permission system wink... lol
Posted By: sirdude Re: [7.2.1] - Group feature permission matrix - 08/29/2007 1:33 PM
no, you don't whine giz... i'd more liken it (in a nice way of course) to the little dog at the party who keeps following you around and trying to hump your leg laugh
Posted By: Gizmo Re: [7.2.1] - Group feature permission matrix - 08/29/2007 2:05 PM
What a coincidence, that is me at a party... Though I end up on more leg's than what you'd think... wink...

You should see me at the clubs with a few (8) drinks in me :X
© UBB.Developers