mm:cloud and authenticate class

2 views
Skip to first unread message

André van Toly

unread,
Jan 24, 2012, 10:40:35 AM1/24/12
to mmbase-...@googlegroups.com
When using:

<mm:cloud method="delegate" authenticate="class">
..
</mm:cloud>

For example in a file /test.jspx. Do you have to include that file in somewhere in a configuration file?

---André

--
André van Toly
web http://www.toly.nl mobile +31(0)627233562
irc irc://irc.slashnet.org/#mmbase
twitter twitter://twitter.com/#!/elfuego2
----------------------------------------------------------------~~<<>>~~

Michiel Meeuwissen

unread,
Jan 24, 2012, 12:22:29 PM1/24/12
to mmbase-...@googlegroups.com
2012/1/24 André van Toly <an...@toly.nl>:

> When using:
>
>  <mm:cloud method="delegate" authenticate="class">
>   ..
>  </mm:cloud>
>
> For example in a file /test.jspx. Do you have to include that file in somewhere in a configuration file?

Yes, you could add test.jspx in the class-authentication.xml Not that
you must do that with a regular expression on the java class. The java
class of a jsp can be a bit tricky. Find it out with
<jsp:expression>this.getClass()</jsp:expression> or so.

There may also be a generic class-authentication configuration matching on .*.


--
mihxil'  http://meeuw.org
0614591299
nl_NL eo_XX en_US

André van Toly

unread,
Jan 27, 2012, 6:37:36 AM1/27/12
to mmbase-...@googlegroups.com
Op 24 jan. 2012, om 18:22 heeft Michiel Meeuwissen het volgende geschreven:
> 2012/1/24 André van Toly <an...@toly.nl>:
>> When using:
>>
>> <mm:cloud method="delegate" authenticate="class">
>> ..
>> </mm:cloud>
>>
>> For example in a file /test.jspx. Do you have to include that file in somewhere in a configuration file?
>
> Yes, you could add test.jspx in the class-authentication.xml Not that


That is /config/security/classauthentication.xml ?

> you must do that with a regular expression on the java class. The java
> class of a jsp can be a bit tricky. Find it out with
> <jsp:expression>this.getClass()</jsp:expression> or so.
>
> There may also be a generic class-authentication configuration matching on .*.

If is have a file /action/stats.jspx that would have to be something like this?

<authenticate class=".*\.action\.stats_jspx">
<property name="username" value="foo" />
</authenticate>

---André

>
>
> --
> mihxil' http://meeuw.org
> 0614591299
> nl_NL eo_XX en_US
>

> --
> You received this message because you are subscribed to the Google Groups "mmbase-discuss" group.
> To post to this group, send email to mmbase-...@googlegroups.com.
> To unsubscribe from this group, send email to mmbase-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/mmbase-discuss?hl=en.

André van Toly

unread,
Jan 27, 2012, 7:34:54 AM1/27/12
to mmbase-...@googlegroups.com
OK. ".*\.action\.stats_jspx etc." seems to work. But besides some jspx templates I also have a function, that not only creates media nodes, but that needs properties and wants to send an email when finished. But I get exceptions on those for 'normal' users (rank: site user).

<authenticate class="org\.mmbase\.streams\.download\.DownloadFunction">
<property name="rank" value="site user" />
</authenticate>

<authenticate class="org\.mmbase\.module\.builders\.Properties">
<property name="rank" value="site user" />
</authenticate>

I get: "org.mmbase.security.SecurityException: Operation 'create' on 59 was NOT permitted to ..". In which 59 is the typedef for properties builder in my installation.

59 has owner system, when I change that to 'site user' everything is OK, but why does the former method not work?

---André

Michiel Meeuwissen

unread,
Jan 27, 2012, 1:28:56 PM1/27/12
to mmbase-...@googlegroups.com
2012/1/27 André van Toly <an...@toly.nl>:

> OK. ".*\.action\.stats_jspx etc." seems to work. But besides some jspx templates I also have a function, that not only creates media nodes, but that needs properties and wants to send an email when finished. But I get exceptions on those for 'normal' users (rank: site user).
>
>  <authenticate class="org\.mmbase\.streams\.download\.DownloadFunction">
>    <property name="rank" value="site user" />
>  </authenticate>
>
>  <authenticate class="org\.mmbase\.module\.builders\.Properties">
>    <property name="rank" value="site user" />
>  </authenticate>
>
> I get: "org.mmbase.security.SecurityException: Operation 'create' on 59 was NOT permitted to ..". In which 59 is the typedef for properties builder in my installation.
>
> 59 has owner system, when I change that to 'site user' everything is OK, but why does the former method not work?

I don't understand why you don't class authenticated it to some user
which can create properties then.

André van Toly

unread,
Jan 28, 2012, 3:23:41 AM1/28/12
to mmbase-...@googlegroups.com

You mean this?

<authenticate class="org\.mmbase\.module\.builders\.Properties">

<property name="username" value="foo" />
</authenticate>

Has no effect.

---André

>
>
> --
> mihxil' http://meeuw.org
> 0614591299
> nl_NL eo_XX en_US
>

Michiel Meeuwissen

unread,
Jan 30, 2012, 3:27:38 PM1/30/12
to mmbase-...@googlegroups.com
2012/1/28 André van Toly <an...@toly.nl>:

>> I don't understand why you don't class authenticated it to some user
>> which can create properties then.
>
> You mean this?
>
>  <authenticate class="org\.mmbase\.module\.builders\.Properties">
>    <property name="username" value="foo" />
>  </authenticate>

No. And that doesn' t make much sense either. The Properties builder
is doing any (class) authenticating, so it is not in the call stack
yet. You need to authenticate a class which is. I suppose your code
call the properties builder, not inversely.

Michiel

André van Toly

unread,
Feb 1, 2012, 11:00:45 AM2/1/12
to mmbase-...@googlegroups.com
Op 30 jan. 2012, om 21:27 heeft Michiel Meeuwissen het volgende geschreven:
> 2012/1/28 André van Toly <an...@toly.nl>:
>
>>> I don't understand why you don't class authenticated it to some user
>>> which can create properties then.
>>
>> You mean this?
>>
>> <authenticate class="org\.mmbase\.module\.builders\.Properties">
>> <property name="username" value="foo" />
>> </authenticate>
>
> No. And that doesn' t make much sense either. The Properties builder
> is doing any (class) authenticating, so it is not in the call stack
> yet. You need to authenticate a class which is. I suppose your code
> call the properties builder, not inversely.

OK. That would be this part:

<authenticate class="org\.mmbase\.streams\.download\.DownloadFunction">

<property name="username" value="foo" />
</authenticate>

But that did not do the trick. See the mmbase streams application.

---Cheers, André

>
> Michiel
>
>
> --
> mihxil' http://meeuw.org
> 0614591299
> nl_NL eo_XX en_US
>

Reply all
Reply to author
Forward
0 new messages