You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@etch.apache.org by Juan Padilla Julian <jt...@gmail.com> on 2009/01/16 13:52:09 UTC

@Authorize scope

I´m converting my plain etch services in same etch services using 'mixin'
but I'm having problems with @Authorize directive.

In this example I need 'testmixin.etch' methods to have the access controled
by global @Auhorize directive from main DateTimeService

Now I can call getMessage() method without invoke login(..) method and this
isn't good for me.

=== testdate.etch ===

@Authorize( isLoggedIn )
service DateTimeService {

exception Failure ()

@Authorize( true )
 void login( string name, string pwd ) throws Failure
 @Authorize( true )
 void logout()
 @Authorize( true )
 @Direction( Both )
boolean isLoggedIn()

Datetime getDateTime()
 mixin testmixin
}


=== testmixin.etch ===

service TestMixinService {
string getMessage()
}

Re: @Authorize scope

Posted by scott comer <sc...@cisco.com>.
hmmm. it will be true, i suppose, that no global attributes applied to a 
service will be applied
any services mixed in.

the current mechanism for mixin is to combine the namespaces and plumb 
it all together but to use
the mixed in codes as much as possible.

we could quibble about whether that's a bug or a feature. either way, 
what you're trying to do
won't work.

scott out

Juan Padilla Julian wrote:
> I´m converting my plain etch services in same etch services using 
> 'mixin' but I'm having problems with @Authorize directive.
>
> In this example I need 'testmixin.etch' methods to have the access 
> controled by global @Auhorize directive from main DateTimeService
>
> Now I can call getMessage() method without invoke login(..) method and 
> this isn't good for me.
>
> === testdate.etch ===
>
> @Authorize( isLoggedIn )
> service DateTimeService {
>
> exception Failure ()
>
> @Authorize( true )
> void login( string name, string pwd ) throws Failure
> @Authorize( true )
> void logout()
> @Authorize( true ) 
> @Direction( Both )
> boolean isLoggedIn()
>
> Datetime getDateTime()
> mixin testmixin
> }
>
>
> === testmixin.etch ===
>
> service TestMixinService {
> string getMessage()
> }
>