Advertisement:

Author Topic: Managing permissions for an addon  (Read 7269 times)

JAAulde

  • Guest
Managing permissions for an addon
« on: September 13, 2004, 09:25:58 AM »
Hello,

I am programming a site that has SMF as the forums, as well as the system that checks user login/information throughout the rest of the site (via SSI.php).

There are several features on this site that I want all members to have rights to upon sign up, but should they abuse a feature, I can block them from it without blocking them from anything else.

Let's discuss it in terms of a single feature for now.  How do I allow all members access to this feature until I determine they have abused it?  Should I create a member group and check to see if they belong to that group before continuing with the feature program?  If not, what else is available?

If the member group is the way to go, how do I ensure all members are added to the group immediately upon sign up?  I also don't want the adding of this user group to affect any of the standard permissions a user should have on the boards upon sign up--they should not have any special privileges on the board because they are in the group--I just want to check if they are in the group before I give them access to this feature outside the boards.

I hope this makes sense.  All the permission stuff and member groups always confuse me.   :-[

Thanks to anyone who offers help!

Jim

Offline Elissen

  • Full Member
  • ***
  • Posts: 466
  • Gender: Male
    • ICSC
Re: Managing permissions for an addon
« Reply #1 on: September 13, 2004, 09:49:45 AM »
Using membergroups is the way to go if you don't want to modify the source of SMF I think. And you can do it the other way around, if they are a member of a certain group then deny it :). And if you don't want other members to see if a person has been "restricted" you can select that membergroup under "additional membergroups" in their profile. Only admins can see that.

Code: [Select]
<?php
        
global $user_info;
        if (!in_array(9$user_info[&#39;groups&#39;])) {
        // the extras
        }
?>
Where 9 is the id of the excluded membergroup

JAAulde

  • Guest
Re: Managing permissions for an addon
« Reply #2 on: September 13, 2004, 09:56:01 AM »
Excellent!  I thank you kindly and will look into your suggestion.  Seems it's the way to go.

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Managing permissions for an addon
« Reply #3 on: September 13, 2004, 07:17:50 PM »
Permissions are nice too ;).  I'll be writing a full-fledged tutorial on them in not too long...

-[Unknown]

Offline Elissen

  • Full Member
  • ***
  • Posts: 466
  • Gender: Male
    • ICSC
Re: Managing permissions for an addon
« Reply #4 on: September 14, 2004, 04:26:04 AM »
Now your making me curious :)

Offline [Unknown]

  • SMF Friend
  • SMF Master
  • *
  • Posts: 36,102
  • Gender: Male
Re: Managing permissions for an addon
« Reply #5 on: September 14, 2004, 03:11:08 PM »
Well, as an example, you could say:

if (allowedTo('who_view'))
  echo 'You\'re so awesome, we\'ve allowed you to view who\'s online!!';

-[Unknown]

Offline Elissen

  • Full Member
  • ***
  • Posts: 466
  • Gender: Male
    • ICSC
Re: Managing permissions for an addon
« Reply #6 on: September 16, 2004, 03:23:52 AM »
I know that principle, but my worries are more with upgrading. I'm hesitant to make changes to the source files of SMF becouse of it. I know the package manager should be able to reapply them, but when I tried to make a package of some other changes I ran into some problem that the package manager failed to apply the mod. Probaly an error on my part.

But that is an entirely different topic :)