[Cartoweb-users] permissions on query plugin and my own plugin

Oliver Christen oliver.christen at camptocamp.com
Mon Feb 18 05:11:41 EST 2008


oh, it is my fault
I forgot to remove the $ of '$exampleRecenter_allowed', as it should be a 
string
correct code is:
$template->assign('exampleRecenter_allowed', $hasRoleMyrole);

try that

> Hi!!
> In ClientMyplugin.php I have written as following:
>
> public function renderForm(Smarty $template) {
>     $sm = SecurityManager::getInstance();
>     $hasRoleMyrole = $sm->hasRole('loggedIn');
>     // which return true or false
>     $template->assign('$exampleRecenter_allowed', $hasRoleMyrole);
>   //     print_r ($hasRoleMyrole);
>   $template->assign('exampleRecenter', $this->drawUserForm());    if 
> ($this->noresult) {
>    $template->assign('errormsg', '<center><b> Nessun Risultato, ripetere 
> la ricerca!</b></center>');
>    }
>
> and in the cartoclient template as following:
>
> {if $exampleRecenter_allowed}
>     {$exampleRecenter}
>     {$errormsg}
>    {/if}
>
>
> but, i am not able to use my plugin even if i am legged in...
>
> print_r ($hasRoleMyrole); ------> returns 1 when i am logged
>
>
>
> Oliver Christen ha scritto:
>> well, the *_allowed variable are not set automaticaly, they are set by 
>> plugins explicitely. Only a few plugins have already security check build 
>> in: layers and exportPdf
>>
>> if you want to "secure" a plugin, you need to add a security check which 
>> will get the current user's role and set the corresponding 
>> smarty(template) variable
>>
>> $sm = SecurityManager::getInstance();
>> $hasRoleMyrole = $sm->hasRole('myrole');
>> // which return true or false
>> $template->assign('$exampleRecenter_allowed', $hasRoleMyrole);
>>
>>
>>
>>> Hi!
>>> I'd like to give permissions to query plugin and my own plugin 
>>> (ExampleRecentering).
>>> In the plugin.ini file I've set:
>>>
>>> general.allowedRoles = myrole
>>>
>>> without positive results...so I think i have to change somenting in the 
>>> template file, so I've written somenting like this:
>>>
>>> {if $exampleRecenter_allowed|default:''}
>>> ...
>>> ...
>>> {else}
>>> {t}lLgin{/t},<a href="?login=y&project={$project}">{t}login{/t}</a>
>>> {/if}
>>>
>>> but nothing...
>>>
>>>
>>> Oliver Christen ha scritto:
>>>> not by default
>>>> this would be possible with a custom plugin though, but that means 
>>>> doing some programmation.
>>>>
>>>> regards
>>>> Oliver
>>>>
>>>>> Hi!
>>>>> Is it possible to assign permissions on EXTENT of a map, so that USER1 
>>>>> can display a different spatial region of the same map rispect to 
>>>>> USER2, USER3, etc...
>>>>>
>>>>>
>>>>> Thanks!
>>>>>
>>>>> -- 
>>>>> Ing. Fabio D'Ovidio
>>>>>
>>>>> iQuadro - Informatica e Innovazione s.r.l.
>>>>> Via C. Pisacane 23, Aversa (CE) - 81031
>>>>> Web : www.ii2.it
>>>>> Tel.: 081 197 57 600
>>>>> mail: fabiodovidio at gmail.com
>>>>>
>>>>> _______________________________________________
>>>>> Cartoweb-users mailing list
>>>>> Cartoweb-users at lists.maptools.org
>>>>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>>>>
>>>>
>>>>
>>>
>>> -- 
>>> Ing. Fabio D'Ovidio
>>>
>>> iQuadro - Informatica e Innovazione s.r.l.
>>> Via C. Pisacane 23, Aversa (CE) - 81031
>>> Web : www.ii2.it
>>> Tel.: 081 197 57 600
>>> mail: fabiodovidio at gmail.com
>>>
>>> _______________________________________________
>>> Cartoweb-users mailing list
>>> Cartoweb-users at lists.maptools.org
>>> http://lists.maptools.org/mailman/listinfo/cartoweb-users
>>>
>>
>>
>
> -- 
> Ing. Fabio D'Ovidio
>
> iQuadro - Informatica e Innovazione s.r.l.
> Via C. Pisacane 23, Aversa (CE) - 81031
> Web : www.ii2.it
> Tel.: 081 197 57 600
> mail: fabiodovidio at gmail.com
>
> 



More information about the Cartoweb-users mailing list