Rendering uiXML components depending on JAAS role
Hi,
I've read "J2EE Security in Oracle ADF Web Applications" on OTN. It is very usefull for me and helps me very much.
I note how it possible to vary components behaviour depends on the security role in JSP. For example I can show a submit button to one user and don't show for other.
The question is:
Can I do the same things with uiXML? If it is possible, could somebody provide me with the example?
Thabk you.
Jonas,
Thank you for replay. Yes, I know I can use EL in render property of components. But bindings.username return empty field in my case. I use jazn-data.xml as user/role repository and Basic authentication. So for now I can't access user or role name via bindings. Also I prefer to access role name because I have several users with the same role. Every user in the role should be able to see the button (for example).
Is there any way to access user or role name via bindings?
Thanks.
Similar Messages
-
Creating group dynamically in active directory depending on their role
Hi,
I have sycn oid and active directory using directory integration platform. Now the scenario is We have one system says hr system which take care of entering all the user information. Once it submit that information it goes to oid. Now we want that when we import all that user from oid to active directory it didn't duplicate any user as well as depending on their role it should create groups dynamically in active directory. For e.g: If user belong to Trainee category or manager category it must create Trainee group & Manager group & respective person should go into that group. I don't know whether my question is placed in right group or not. I am using filter to do this task but not able to write proper condition in "source matching filter" and "destination matching rule". Any help will be appreciated.
Thanks,
Sonya SharmaThanks Tamim. To clear your thought, i will explain again. I have sync oid and active directory through Directory integration platform. I have created user in oid.(cn=users,dc=mycompany,dc=com). It get sync in active directory properly. Now i have created two group in active directory say for e.g Trainees and Manager. There is a field name position in oid which is a custom attribute. When i fill the information of user in oid, I have to fill "Position" attribute also. So my question is that, if i fill Trainee as a value in Position attribute and click on submit it should go in Trainee Group In active directory and not in user group. Same for manager. How can we achieve this? Can we do it through filter? Or any other way? It's needed desperately. Please help me in resolving this issue.
Regards,
Sunil -
Redirecting user to acustom page depending on security role after glassfish
Hi,
I have a JSF application using glassfish authentication mechanism. I'm planning to use a jdbc realm and form based authentication (I'm using a jsp page to get username and password) . I have 3 different user roles (student, admin and staff)
However I cannot find how to redirect a user to a different page (Ex: staff report page if the logged in user is in the security role staff). I have configured sun-web.xml and web.xml to map the roles and groups. The problem is after authentication the user is always redirected back to the home page, which is the login page. I understand this is how the glassfish authentication works by default. But is there a way to navigate the user to a different page depending on his role.
I'm new to EJB security. Please help me on this subject. Thanks a lot in advance.Check this blog post, which provides an alternate solution (You can choose the best possible solution based on your use-case).
http://andrejusb.blogspot.com/2007/10/security-in-oracle-adf-and-automatic.html
Thanks,
Navaneeth -
Declarative security of servlet- html view changes depending upon the role ??
Hi All,
There is acl for ejb methods and we can restrict roles to use certain
methods of the bean. Now my question is that
Is something possible in a declarative fashion so that user can have
certain options enabled and certain disabled in the jsp/servlet output
depending upon his role ?
For example, let suppose we have a servlet MyServlet that creates an
html output with some input boxes and buttons (add, modify, delete). Now
is it possible, that ceratin user will only see modify button, some
won't see any button, can only view the screen depending upon their role
and verything in declarative fashion ?
Any suggestion is welcome.
TIA,
Sudarson
Servlet security is defined in the context of the web application containing
the servlet, and web app security provides for the declarative protection of
resources like servlets, jsps and html pages; so the answer is no.
See http://e-docs.bea.com/wls/docs61///webapp/security.html
Thanks
Jim
sudarson wrote:
> Hi All,
>
> There is acl for ejb methods and we can restrict roles to use certain
> methods of the bean. Now my question is that
>
> Is something possible in a declarative fashion so that user can have
> certain options enabled and certain disabled in the jsp/servlet output
> depending upon his role ?
>
> For example, let suppose we have a servlet MyServlet that creates an
> html output with some input boxes and buttons (add, modify, delete). Now
> is it possible, that ceratin user will only see modify button, some
> won't see any button, can only view the screen depending upon their role
> and verything in declarative fashion ?
>
> Any suggestion is welcome.
>
> TIA,
> Sudarson
[Reply.vcf]
-
Create Incident via CRM_UI, non-SAP components depending of sold-to-party
Hello!
We are using CRM_UI on Solman 7.1 ( SPS 10 ) to create Incidents. On the 3'rd step there is option to select SAP Components or non-SAP Components if defined. We are using a lot of non-SAP components.
Is it possible to prevent users to choose all SAP component, only few of them depending of customer ( BP sold-to-party )? Does it exist authorisation object for this?
Thank's in advance!
Best regards,
RenatoHello,
Please run SPRO tcode and search for
Maintain User Application Components
Use
This activity maintains your application components. Create your own component hierarchy, and add it to the default SAP application components.
Recommendation: Choose component names that are easy to recognize and distinguish.
Activities
1. Specify a component. If your components are hierarchical, enter the leading component first.
2. Enter a description of the component.
3. Specify the hierarchy level of the component (01-0n). Create the component hierarchy top-down.
4. Specify the node type. Use node type 0 for a header, and 1 for normal nodes.
5. Flag whether the node is selectable.
6. Save.
To configure the display of value help in the SAP component search, edit the VH_SAPCOMP_TREE parameter in the Define Parameters activity.
BR,
K. -
JSP 2.0 tag files for rendering JSF components
Over the weekend I read up on new JSP 2.0 features (dunno why I waited this long??) ... I really liked the tag file feature ...
I was wondering if it were a good idea to use these tag files as renderers for JSF components - ok, this ties us to a JSP only solution but how many in here would be using a non-JSP solution anyway?
I was thinking along the foll. lines:
<myComponent id="myComponent1" attr1="value1" attr2=value2">
<myComponentRenderer var="myComponent1" />
</myComponent>
myComponentRenderer can be implemented as a tag file in myComponentRenderer.tag ... The myComponent tag delegates the business logic processing to its associated UIComponent and then sets this component as a pageContext attribute with the id "myComponent1" ... myComponentRenderer in turn gets a reference to this UIComponent and renders it ...
Again, if one wants a different way of rendering, make another tag file myComponentRenderer2.tag or change myComponentRenderer.tag itself ...
Indeed, this may not work for components with complicated rendering logic but I believe that's only the 20% case ...
Comments?
P.S.:
I've picked this up from http://forums.java.sun.com/thread.jsp?forum=427&thread=381052&tstart=0&trange=15
This also compliments another topic: http://forums.java.sun.com/thread.jsp?forum=427&thread=413515&tstart=0&trange=15You are right in saying that decoding has nothing to
do with rendering per se.I will go even further than Erik did, and dispute this statement.
Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
The "renderer" really does
two completely different things. But both should
nevertheless be separate from the component
implementation itself. You could still have the
renderer doing the decoding part, which arguably would
rarely change, and somehow delegate the actual
rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
Craig -
Showing or hiding buttons/ enabling text boxes depending upon security role in Portal
Hi All,
Is it possible to show or hide ceratin text box or buttons depending on the security
role of the user ? Let's suppose we have screen with buttons update, delete. Now
we want that when a administrator logs in he will see a screen with data in editable
text boxes and update and delete button. In case of normal user, only the phone
no. will be editable and he can't see the delete button.
Is it possible using portal feature ?
Any suggestion is welcome.
TIA,
SudarsonSudarson,
Not that I know of. If you'd like to eloborate on the feature you're
building I can log an enhancement request for you.
Sincerely,
Daniel Selman
"sudarson" <[email protected]> wrote in message
news:3c5f698e$[email protected]..
>
Hi Daniel,
Thanks for the reply. I think, I should elaborate my query.
Yeah, programattically we can do the stuff. But my question is that isthere any
such feature in weblogic portal so that in stead of using is UserInRoleand doing
it programatically, we can do it thru portal, thus having bettermaintainability.
>
Regards,
Sudarson
"Daniel Selman" <[email protected]> wrote:
Sudarson,
Yes this is possible. You can programmatically check the logged in user's
role within your JSP and react accordingly (all standard J2EE). You
should
do this with caution however as you could quickly create a maintenance
problem for yourself. Declarative security externalizes all security
settings (groups. permissions etc.) away from application code and is
usually to be preferred.
Programmatic security through EJB mechanisms such as the SessionContext
isCallerInRole and getCallerPrincipal methods and web-tier methods
getRemoteUser, isUserInRole and getUserPrincipal.
http://java.sun.com/j2ee/j2sdkee/techdocs/guides/ejb/html/Security5.html
Sincerely,
Daniel Selman
"sudarson" <[email protected]> wrote in message
news:3c5e81cf$[email protected]..
Hi All,
Is it possible to show or hide ceratin text box or buttons dependingon
the security
role of the user ? Let's suppose we have screen with buttons update,delete. Now
we want that when a administrator logs in he will see a screen withdata
in editable
text boxes and update and delete button. In case of normal user, onlythe
phone
no. will be editable and he can't see the delete button.
Is it possible using portal feature ?
Any suggestion is welcome.
TIA,
Sudarson -
im planning to make my web application secured by declarative security method
i had configuired few roles in my web.xml
i made a login page and from there im triggering JAAS which is returning me with the subject which contains a principle which i expected (prinicple object has a role set) and im storiung this in session for future use
Now the problem is from there if i want to navigate to some other pages its throwing me forbidden which says that i need to do some more thing like setting up that role some where. where my web app can read when filtering...
where should i do that ..?and how ..
pls help
thanks i advance..You should take this question to the Servlet forum or the Glassfish forum on java.net. This is a web-security question and not a cryptography question.
-
Tag files for rendering JSF components
Hi people!
It is possible to render component JSF using Tag-Files? (WEB-INF/tags).
I am having problems with context, seems that the JSF does not recognize pageContext.
Ex:
My Tag-File
<%@ attribute name="nameproperty" required="true" rtexprvalue="true" %>
<%@ attribute name="size" required="true" rtexprvalue="true" %>
<h:inputText id="${nameproperty}" size="#{size}" />
My JSP
<%@ taglib tagdir="/WEB-INF/tags" prefix="mayTags"%>
<f:subview id="id001" >
<myTags:myText propriedade="name_test" size="30" />
</f:subview>
In this in case that the size always is empty, because it does not recognize the target pageContext, but if I to place the size in the target of request already recognizes.
EX:
<%@ attribute name="nameproperty" required="true" rtexprvalue="true" %>
<%@ attribute name="size" required="true" rtexprvalue="true" %>
<c:set var"size" value="${size}" scope="request" >
<h:inputText id="${nameproperty}" size="#{size}" />
In part it decides my problem, but it causes another error, is that if in my JSP it will have two fields (this is more than common) calling tag-file, there the size placed in request is always of it I finish field.
Ex:
<%@ taglib tagdir="/WEB-INF/tags" prefix="mayTags"%>
<f:subview id="paisMan" >
<myTags:myText propriedade="name_test" size="30" />
<myTags:myText propriedade="name_test_2" size="70" />
</f:subview>
In this case all the two inputText would have size 70.
It has some thing that I can make to solve this problem?
Thanks for any help.
Pedro Neves - BrazilYou are right in saying that decoding has nothing to
do with rendering per se.I will go even further than Erik did, and dispute this statement.
Consider that you are generating an <input> tag for a text field. Among other things, you have to generate a "name" attribute. Who decides what to put there? The renderer that actually created the markup.
The "renderer" really does
two completely different things. But both should
nevertheless be separate from the component
implementation itself. You could still have the
renderer doing the decoding part, which arguably would
rarely change, and somehow delegate the actual
rendering to an implementation in a tag file.Whether you implement decoding in a separate class or inside the component, what request parameter name do you look for? It is not reasonable to assume that ALL possible renderers will choose the same parameter name ... hence, decoding and encoding are inextricably linked (the code doing the decoding has to know what kind of markup the code doing the encoding actually created). In JavaServer Faces, the current APIs create that linkage by requiring that the decode and encode be done by the same class (either the component, if you are not delegating, or the renderer if you are).
Craig -
Enable/Disable Button Depending On User Role
Hi all,
I have some buttons in a portlet. I have consumed this portlet in a webcenter portal application. Now i want to disable/enable these buttons according to the user role. How can i achieve this??
Thanks,
DhirajThinking aloud,
- should the button be a resource from Webcenter, you could modify its visibility (property) via EL: #{WCSecurityContext.userInGroup['Administrators']} will display the button only if the user is in Administrators group
- does your portlet have a parameter like that? If so, you should be able to fill it in with EL. If not, I doubt you will be able to achieve visibility changes - you might try to contact the producer of your portlet to do the necessary changes, though. -
Showing non rendered adf components
Hi,
When I set my ADF table to rendered=false at design time (to enable it conditionally at runtime), it disappears from design view too. I find this to be strange and annoying behaviour as that makes it difficult to design, I have to keep changing the attribute from false to true between design time and runtime. Surely this should only affect the display during runtime?
Is there any way to have it not hide the component during design time?
RSince you're rendering it conditionally at runtime, you can enter the EL condition into the rendered attribute. The designer evaluates it to true so it still shows up on the page. Of course, you'll have to put in the EL into the source directly since the attribute editor doesn't initially allow you to use the EL editor.
-
My website renders completely differently depending on the browser
The website http://MycoTechCorp.com renders beautifully in Chrome most of the time. In Firefox, (25.0.1) panels are completely mismatched, and some text just randomly does not show up. Internet Explorer (10) has the same problems as Firefox. It seems to me that a program like Muse would be optimized for all the main browsers.
Hi Vicki,
Please check the following link: http://testframesize.businesscatalyst.com/index.html
If you click and drag down the bottom right corner of the white textbox on the page, you will see that it does two things-
1. It expands the grey box that houses that white textbox.
2. It pushes down the red box that sits at the bottom of grey box while staying aligned with the bars on left.
This is the kind of setup you would need to take control of the alignment of bars on your site's pages.
Currently you have used 6 independent boxes with different colors to achieve the effect and this independence is what is causing the issue.
As Zak explained about the way different browsers handle text differently (which you can test by checking the Reishi page in Firefox and Chrome) the issue is that since all your rectangles are sitting independently, not caring about the others, when a browser asks for more room for text, the big grey box complies since the textframe is within that grey box. The light red box below the grey box also gives way since you have placed it right below the grey box. However the ones on left are not affected by this expansion and hence keep their size.
You can get around that issue by using 3 rectangles (instead of 6) and carefully placing them one above the other (making sure they don't overlap). As for the bars on the left, you can use 1 or 2 pixel high and 30 pixel wide images (of required color) as fill for the 3 rectangles - just set the Fitting to "Tile Vertically" and Position as top-left corner.
That is the way I created the content on above link.
I have sent the .muse source file for the above site to you via email.
Hope this helps.
Cheers,
Vikas -
Display buttons depends on Role
Hi,
May I Know how to displaying the buttons depends on user roles. can you give example with code it will helpful to meUse EL expressions in <tt>disabled</tt> or <tt>rendered</tt> properties of the corresponding command components. For example, if you want to disable a button if the user is not a member of an ADF Application Role called <tt>Configurator</tt> then you may use code similar to the following:
<af:commandButton ... disabled="#{!securityContext.userInRole['Configurator']}">or if you do not want to render the button if the user is not a member of the role:
<af:commandButton ... rendered="#{securityContext.userInRole['Configurator']}">Note, that the specified role must be an ADF Application Role (defined by you using the ADF Security wizard) but not a WebLogic entrerprise group. -
Best practice to rendering components in latest jDEV 11.1.1.3
All,
I am working on jDEV 11.1.1.3. One of my requirement is to disable / rendering the fields depending on the status of the column in the database. I would like what would be best practice to implement this. Do we need to add the logic in the "beforePhase" or in the application module? If it's in the application module how can we get the handle to the components on the page? I am getting exceptions when I added the logic in the "beforePhase" method ("Target can not be reachable") even though I have added the managed bean adfc-config file.
ThanksHi,
for the lable -->shortDesc just bind it to a variable on the managed bean and set whatever you want for it.
If I get your question correctly you want to change the state of a componet in view dynamically base on some Database logic on model.
this case is possible but not very easy.
for example the hidden attirbute for a component can be set in the model in the control hint.
if you want to dynamically render or not render a component you have to override the controlhint of the view.
in the control-hint you will return true o false programmically, I have done this for updateble attribute of the componet so my field on the view would be programmically be updateble if I set some attibute on the view. (it is totally independed to the ADF-Faces and the viewcontroller) it is based on the logic on model.
but this kind of topic are advance and not easiy handled.
if you want more information about it I hope to be able to help you.
Thanks. -
LOV(selectinechoice)'s Rendering depending on selectedRadioButtonitem
Hi
i am using the jdev 11g update 1 .i am building the fusion webaplication(ADF).
I have the requirement ,to put the LOv based on the selected radio button.
I have time periods like year,month,days,quarter,weeks .In selectoneRadio component i have year,month,days,weeks,quarter as
items.
if user select the year,i have to display the year LOv.
If user select the month i have to display the month and year LOV.
If user select the days ,i have to display the days ,month,year LOv.
If user select the weeks,i have to display the week,year LOV.
so depending on the selected radio button my LOV's should change.
I want my logic should work like below
I am puuting all the LOV's in page but i am rendering those LOVs depending on the radio button selected .
to write the ELExpression in render attribute of LOV's how can i get the selected value of the selectoneradio component.
my code for selectoneradio is
<af:selectOneRadio label="Timeperiods">
<af:selectItem label="years" value="years">
<af:selectItem label="months" value="months">
<af:selectItem label="Days" value="Days">
<af:selectItem label="weeks" value="weeks">
<af:selectItem label="Quarters" value="Quarters">
<af:selectoneradio>
same way i have the selectonechoice as below.
<af:selectOneChoice label="years">
<af:selectItem label="2009" value="2009">
<af:selectItem label="2008" value="2008">
<af:selectItem label="2007" value="2007">
<af:selectItem label="2006" value="2006">
<af:selectItem label="2005" value="2005">
<af:selectoneChoice>
<af:selectOneRadio label="Month">
<af:selectItem label="jan" value="jan">
<af:selectItem label="feb" value="feb">
<af:selectItem label="march" value="march">
<af:selectItem label="apr" value="apr">
<af:selectItem label="may" value="may">
<af:selectoneradio>
like this i have lov's for weeks,days,quarters.
How can i write the logic for the LOV's sholud render depend on the selected radio button.if anyone know,pls
provide me the codelines.or any blogs related to this or any suggestions.
SailajaHi Sailaja,
Try this.
<af:selectOneRadio label="Timeperiods" id="selectOption"
binding="#{backingBean.selectOption}"
autoSubmit="true">
<af:selectItem label="years" value="years"/>
<af:selectItem label="months" value="months"/>
<af:selectItem label="Days" value="Days"/>
<af:selectItem label="weeks" value="weeks"/>
<af:selectItem label="Quarters" value="Quarters"/>
</af:selectOneRadio>
<af:panelGroupLayout partialTriggers="selectOption">
<af:selectOneChoice label="years"
rendered="#{backingBean.selectOption.value == 'years'}">
<af:selectItem label="2009" value="2009"/>
<af:selectItem label="2008" value="2008"/>
<af:selectItem label="2007" value="2007"/>
<af:selectItem label="2006" value="2006"/>
<af:selectItem label="2005" value="2005"/>
</af:selectOneChoice>
<af:selectOneRadio label="Month"
rendered="#{backingBean.selectOption.value == 'months'}">
<af:selectItem label="jan" value="jan"/>
<af:selectItem label="feb" value="feb"/>
<af:selectItem label="march" value="march"/>
<af:selectItem label="apr" value="apr"/>
<af:selectItem label="may" value="may"/>
</af:selectOneRadio>
</af:panelGroupLayout>Regards,
Chan Kelwin
Maybe you are looking for
-
Highlighting in Adobe Reader 9? I've already enabled highlighting but it does not work!
I've already followed the steps posted here: http://forums.adobe.com/thread/430906 and enabled highlighting under preferences but i'm still unable to highlight or comment. I am sure the document allows commenting as I was able to highlight and commen
-
Incomprehensible bills after taking line rental sa...
On 2 August 2010 we paid for one year's rental to start 24 August 2010, with unlimited calls at £4.99 a month to start from the same date. Our bill dated 12 August correctly showed the advance payment for the year, but also included advance payment f
-
Can I establish a symbol to type a phrase
how many times to I type my email address? Can I establish a symbol that when tapped will print my email address?
-
HT201304 i need to go back to the spanish App Store
for some reason im in an App Store that doesnt allow me to buy things, i need to go back to my App Store, im in spain please explain how. tx
-
Handle back functionality in ALV report
Hi, I have created the alv report which has 2 button on the report display, if you select any of them it will display other 2 reports. here i am facing problem in handling the BACK functionality. i.e after the navigations between the 2nd and 3rd repo