Jump to content

Archived

This topic is now archived and is closed to further replies.

newb

usergroup permissions

Recommended Posts

chaps - please take note of the original question. whilst this is all good, and i'm picking stuff up from the argument that i didnt know before, the arguments of hex vs dec, encapsulation vs constants, etc are not gonna help the OP.

you both know your stuff - that's pretty obvious - but can you possibly stick to the topic and present a solution rather than a "best practice" argument?

cheers

Share this post


Link to post
Share on other sites
[quote author=Jenk link=topic=110890.msg450740#msg450740 date=1160615509]
Don't have to use hex, can stick with decimal..

[code]<?php

if (!($perm ^ 2))
{
    $perm = $perm | 2;
}

?>[/code]
[/quote]

2 looks like a literal to me.

redbull, it would appear that the original question has been answered and that the topic has been changed to, "How do we design a system that can handle not only permissions for a forums module, but any other module we decide to add in the future?"

Share this post


Link to post
Share on other sites
@Roopurt & Jenk

I agree with redbull. Cut out the irrelevant arguments, as far as the topic concerned, or I'll knock you heads together and close the thread. If you want to argue the point ad nauseam, do it in the miscellaneous forum.

Share this post


Link to post
Share on other sites
[quote author=roopurt18 link=topic=110890.msg451135#msg451135 date=1160688339]
[quote author=Jenk link=topic=110890.msg450740#msg450740 date=1160615509]
Don't have to use hex, can stick with decimal..

[code]<?php

if (!($perm ^ 2))
{
    $perm = $perm | 2;
}

?>[/code]
[/quote]

2 looks like a literal to me.

redbull, it would appear that the original question has been answered and that the topic has been changed to, "How do we design a system that can handle not only permissions for a forums module, but any other module we decide to add in the future?"
[/quote]Nice of you to ignore my reply after that ;)

I'm done.

Share this post


Link to post
Share on other sites
[quote author=Jenk link=topic=110890.msg450747#msg450747 date=1160616785]Constants break encapsulation.[/quote]

Not always...

[code]<?php
   
    class messages {
       
        const TYPE_ERROR = 1;
        const TYPE_CONFIRM = 2;
       
        function add_message($message, $type = TYPE_ERROR) {
           
        }
    }
   
    //normal use
    $message = new messages();
    $message->add_message("Well done!", messages::TYPE_CONFIRM);
    $message->add_message("Warning though, don't do this again", messages::TYPE_ERROR);
   
?>[/code]

Source: http://www.coderprofile.com/networks/discussion-forum/1694/is-there-a-name-for-this

Kind regards,
Scott

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.