security-role-ref

Moderator: admin

Post Reply
supergiu
Posts: 8
Joined: Thu Sep 25, 2014 2:48 pm
Contact:

security-role-ref

Post by supergiu »

Hi,
sorry but I didn't understand the use of <security-role-ref> element in ebj-jar application component.
From spec 17.3.3 :
The security role references used in the components of the application are linked to the security roles
defined for the application
using <role-link> to link <security-role-ref> to <security-role>.

1. Is <security-role-ref> the same of @DeclareRoles declaration?

2. If yes, can I declare only <method-permission> or @RolesAllowed without either <security-role-ref>or @DeclareRoles?

Thanks!

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: security-role-ref

Post by admin »

If you like our products and services, please help us by posting your review here.

supergiu
Posts: 8
Joined: Thu Sep 25, 2014 2:48 pm
Contact:

Re: security-role-ref

Post by supergiu »

Thank you very much, now the issue is more clear.
Sorry but I've only one doubt.

There is a way to declare a role link using only annotation?

I've just tried to define a role link using @DeclareRoles at class level, and <security-role-ref> on ejb-jar.xml
but without <security-role> definition (with the same value of @DeclareRoles({...})) the ejb-jar.xml is not valid (for xsd).


Thanks again.

admin
Site Admin
Posts: 10046
Joined: Fri Sep 10, 2010 9:26 pm
Contact:

Re: security-role-ref

Post by admin »

No, it cannot be used to declare the role links. If you want to use refs, you have to do that in the xml. See this: http://docs.oracle.com/cd/E19159-01/819 ... index.html
Although it is for EE5, it is applicable for EE 6 as well.
If you like our products and services, please help us by posting your review here.

Post Reply

Who is online

Users browsing this forum: No registered users and 54 guests