options ... individual ..

DroidHost

Well-known member
I know how to create an option for an add-on ... that will be in AdminCP

but what if I want each user can made up his own value of an option ?
or an option will be for each user-group ?
how can that achieved

thanks ...
 
PHP:
....

        $Permission = _getpermissiondModel();
        $Permission->getPermissionsByAddOn('demo');

......

    protected function _getpermissiondModel()
    {
        return $this->getModelFromCache('XenForo_Model_Permission');
    }
if I add a permissiongroup .... etc ...
how can this work ?
 
XenForo_Visitor::getInstance()->hasPermission('group', 'name');

for example

XenForo_Visitor::getInstance()->hasPermission('general', 'viewRagtekArticleSystem')
 
have you checked what hasPermission returns? ;)

start reading the code;)!
PHP:
      /**
     * Gets the value (true, false, or int) of the specified permission if it exists.
     * Used for global permissions which have a group and an individual permission.
     *
     * @param array $permissions Grouped permissions ([group][permission] => value)
     * @param string $group Permission group
     * @param string $permission Permission ID
     *
     * @return true|false|int False if the permission isn't found; the value of the permission otherwise
     */
    public static function hasPermission(array $permissions, $group, $permission)
    {
 
you are amazing ..... 'actually I did read it but .... I did a small mistake I did not capitalize the first latter so my code did not work'
I know now how to do group options, what about users ?

thanks again
 
Top Bottom