protected function retreivePermission($permissions, $check_permissions, $level)
    {
        $sorted_permissions = explode(',', $check_permissions);
        ksort($sorted_permissions);
        
        foreach ($sorted_permissions as $item) {
            $item = trim($item);
            if (! array_key_exists($item, $permissions) && ! empty($item)) {
                $permissions[$item] = $level;
            }
        }
        
        return $permissions;
    }
protected function retreivePermission($permissions, $check_permissions, $level)
    {
        $sorted_permissions = explode(',', $check_permissions);
        ksort($sorted_permissions);
        
        foreach ($sorted_permissions as $item) {
            $item = trim($item);
            if (! array_key_exists($item, $permissions) && ! empty($item)) {
                $permissions[$item] = $level;
            }
        }
        
        return $permissions;
    }
protected function retreivePermission ( $ permissions , $ check_permissions , $ level ) { $ sorted_permissions = explode ( ',' , $ check_permissions ) ; ksort ( $ sorted_permissions ) ; foreach ( $ sorted_permissions as $ item ) { $ item = trim ( $ item ) ; if ( ! array_key_exists ( $ item , $ permissions ) && ! empty ( $ item ) ) { $ permissions [ $ item ] = $ level ; } } return $ permissions ; }
Appends to an array of permissions based on given permission list and level
@param array Permission array to be appended
@param array Permission list to check through
@param int Level of permission
@return array Permission
Appends to an array of permissions based on given permission list and level