• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

options ... individual ..

DroidHost

Well-known member
#1
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 ...
 

DroidHost

Well-known member
#2
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 ?
 
R

ragtek

Guest
#3
XenForo_Visitor::getInstance()->hasPermission('group', 'name');

for example

XenForo_Visitor::getInstance()->hasPermission('general', 'viewRagtekArticleSystem')
 
R

ragtek

Guest
#5
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)
    {
 

DroidHost

Well-known member
#6
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