Access control of plugins with user type

Hey,

We are trying to develop an elgg plugin that acts best as a elgg membership manager. We are trying to have different user types and restrict the access of users to particular users.
For eg, if we have two membership types like FREE and PREMIUM, and plugins like Tidypics, Groups and friends.
we need to limit FREE members from accessing Tidypics and Groups. They should be able to access the friends plugin.

And, PREMIUM members should be able to access Tidypics, Groups and members.
We have a meta data for user type along with each user. But,. I do not find a hook or event that can be used while loading the plugins that check the membership and control the access.

I look forword for your comments.
PLEASE HELP!!!!!!

  • (1)

    Have you checked with WebGalli regarding his design with respect to his own "Premium Members" PlugIn ?"

     

    (2)

    I do believe that this style of restricted access to Plugins and Widgets has already been coded "somewhere" by "someone"... Just ask "Chambo"...

     

  • The membership should be able to cope with levels of membership within a group for those that want an open site, but so that Groups can demand subscriptions (free or paid). 

  • Lovegin John

    @Dhrup,
    Have you used any hooks or event handlers for it?

    Do you have any insights on the plugins..

  • register ==>
    choose - (1) free member,  (2) $10 member,  (3)  $20 member;
    goto paypal, etc,
    pay $$$,
    come back to elggsite and -
    elgg has done the hooks to
    recognize you as a $0,$10,$20
    and then treats you accordingly ;-)

  • Lovegin John

    @Dhrup,

    I have done the first part successfully. Do you have the any idea about the hooks implementing these?

  • Plugins are loaded by engine/start.php when it calls load_plugins().  Now load_plugins() in turn calls is_plugin_enabled() to determine if a plugin should be loaded.  Take a look at is_plugin_enabled().  I think you may be able to write a plugin with start.php like this:

    $u = get_loggedin_user();
    if (!$u || $u is not special) {
        global $ENABLED_PLUGINS_CACHE;
        delete some plugins from $ENABLED_PLUGINS_CACHE;
    }

    Obviously this plugin must come before any plugin that you want to disable.

    This is ugly as it assumes implementaiton details.