Getting User Role in JSPProvider
Hi,
I am developing a simple News portlet which displays different news based on the role of the logged in user.
I am planning to use a simple JSPProvider that has a JSP which includes a different news jsp for each different role. Howeve, i donot know how to get the role of logged in user from the JSP. I've figured out how to get other properties (username, telephonenumber etc) but would appreciate if anybody could point me to appropriate place or give a simple example on how to get role of logged in user from the JSP of JSPProvider.
Thanks,
Apoorv
Thanks a lot Nathalie.
I think you are right. In real life, what you say is correct. But i was just playing around and wanted to do that.
Really appreciate your help.
Similar Messages
-
Getting user roles/credentials? (TOMCAT web auth)
Hi all ! I need a way to retreive the roles/credentals that a user has assigned in the tomcat web auth.
I was using request.getUserPrincipal(), but that returns a string thats not really what Im looking for:
*GenericPrincipal[manusan(Gerencia,)]*
Here manusan is the user and Gerencia is the role. Is there a way to just get the role? or do I have to take split/index the string?.
Thanks!When I was looking at this a year ago I fired off an email to the JAAS guys and the servlet guys. I don't think there's anything that will help you that's in the standards. Perhaps websphere has its own API. I ended up punting and writing my own security layer using Filters and JAAS, with the drawback that my web server security doesn't flow into the EJB tier. Good luck with your project.
-
How to create/get user & role in Weblogic 9.2 programmatically?
Hi,
I am new to Weblogic 9.
I need to create a web service to manage user/role in WebLogic 9.
Searching thru the web and found some classes like:
AtnSecurityMgmtHelper, AtnProviderDescription etc
Are those the correct classes to create/retrieve user & role?
If so, what jar file contains those classes and where is the jar
file?
Thanks in advance,
TerryYou can do it with WLST help
http://e-docs.bea.com/wls/docs92/config_scripting/config_WLS.html#wp1019913
or via JMX through http://e-docs.bea.com/wls/docs92/javadocs/weblogic/management/security/authentication/UserEditorMBean.html and such -
UniqueId while getting users,roles
hi all,
I am new to UME in portals.Can anyone give me an idea on UniqueId which we are getting when we wnat get information of particular user or role..what is that unique id? do every pcd object has its own unique id?Hi,
Yes every object in portal has its own UniqueId.
For User and Group the UniqueId's would look like
USER.PRIVATE_DATASOURCE.un:TestUser123 and
GRUP.PRIVATE_DATASOURCE.un:Administrators
Here you can see that the first part represents the type User/Grup and second part represents the datasource, in the present example it is UME DB, then come the un which is Unique name inside this datasource, then the real Unique name (TestUser123/Administrators)
For Role and all other PCD Objects, the UniqueId is its pcd path. pcd://portal_content/.../myRoleID
Regards,
Praveen Gudapati -
Howto add user role in OID for PORTAL use from wihtin SSO SERVER plugin
Hi all,
Can someone help me with this issue:
I'm developing a custom authentication module for SSO Server. From this plugin I would like to set the roles/groups to which that user belongs, before the redirect to the Portal is done.
I'm adding the user attributes to the OID via the DirContext.modifyAttributes(..) method from within the plugin. However I don't know how to add the roles/group definition to the user entry in the OID so that Oracle Portal can show a personalized desktop when the user logs on.
Hope someone can point me in the right direction.
Many thanks in advance!
Kind regards,
ChrisChris ,
Do you know how to get user role in OID? Did you fix this issue. i have same job in this point.
Thanks -
Easy Question: How to identify user roles within form?
Hi folks,
I would like to display/hide button which calls static data maintenance form (from other form) based on current user roles.
If user has role "STATIC_DATA" granted then DISPLAY button (which calls static data form), else DO NOT DISPLAY it.
Any example, how to get user roles within form?
Thanks,
TomasI can do it with below code:
declare
l_cnt number;
begin
select count(*)
into l_cnt
from user_role_privs
where granted_role = 'STATIC_DATA';
if l_cnt > 0 then
-- display it
else
-- do not display
end if;
end;I think, above should work.
Thanks,
Tomas -
From which table we can get the Role of the User in SRM
Hi All,
I need to prepare a report which displays the user and his role in srm. So from which table i can get the role of the user if i have the Userid.
Thanks
Channappa SajjanarHi
t- code
SUIM->rOLES->BY USER ASSIGNMENT
SELECT WITHASSIGNMENT OF USER = username
AS A OUTPUT YOU MAY GET ROLE ASSIGNED TO THAT USER.
if you want which FM - you debug while executing this report.
regards
Muthu -
You can get Roles but can you get the Role of the user
Can you display or hide items dependant on the roles of the logged in user is assigned too.
I know you can do this for the menu using menu.json
"visible": true,
"applyIf": {
"userHasRoles": ["Administrators"]
But what about for other elements inside the app. Is there a way to get the roles of the user logged in.
Is this missing as a feature or am I missing some pieces.I just want to hide or remove a page element ie if(adminUserRole != 'Admin') {$('#element').remove}. Just some way to see the roles of the admin user that is logged. But yes early days.
On a side note BC are looking to launch the project and advertise the store on the 17th is this not a bit ahead of themselves if there is a potential that apps functionality may be reduced because of new policies, restrictions etc even if only temporarily. Once apps hit the masses this may cause some tension when people loose functions they once had.
Edit :Ok BC have already changed the date of the launch. I jumped the gun in saying this as they have it all under control. -
How to get the type of user role in ISF?
We have functionality to hide all the buttons on Monitor task, which was successfully achieved by javascript. But we need to enable these buttons for only Site Administrators, so that they only can do necessary modifications upon request from end users. Can someone point me to correct direction how to get the user role when a user is not a Site Administrator. Thanks in advance.
What about having your custom ISF onload script first run a db query (on older version called a rcFetch) which would evaluate if the person loading form is a member of the site admin ou.
Here's a rough example:
ISF_onLoad()
rcFetch('Q1','Q1PL=' + UserID);
This will then run a query to validate if the person is a member of the admin ou.
SELECT * FROM DirOrganizationUnitPeople WHERE PersonID = #P1# AND OrganizationalUnitID = 1 (this should be the id of the site admin ou or the ou which you are referring to as an admin)
then have a call back to determine if any records where return, which indicate the person is a member of the site admin ou.
function Q81_DataCallback(retArray, queryList)
if (retArray['Q8500._COUNT_'] == 1)
{ *Show the fields* }
Hope this helps. -
How to get the Role of the logged in User?
Hi All,
Enclosed below is the code am trying to use to get the role for a logged in portal user. But it fails
1. Due to class path errors although I have imported the necessary jar files.
2. Am unable to invoke/find getSAPUser() method or invoke the UMFactory.
Iterator rit = null;
IWDClientUser clientUser = WDClientUser.getCurrentUser();
IUser user = clientUser.getSAPUser();
rit = user.getRoles(true);
IRoleFactory rfact = UMFactory.getRoleFactory();
while (rit.hasNext()) {
String roleName = (String) rit.next();
IRole role = rfact.getRole(roleName);
wdContext.currentContextElement().setRole(role);
What could be the problem and what are the jars that need to imported as I am using EP7.0
Thanks for all your help in advance.
Best regards,
DivyaHi Divya,
Add WD_RUNTIME/com.sap.security/lib/com.sap.security.api.jar to your project`s java build path.
Best regards, Maksim Rashchynski. -
Get the role of a user in portal 6.0
Hello,
I need to get the role of a user in portal 6.0. I want to do this in one of the templates to dynamiclly size our tabs due to the fact some roles have more tabs then others.
travisYou have to use the Identity Server SDK's to do this ..
create SSOToken and AMStore Connection object. Using that you can get the AMUser object and do getRolesDNs to the roles the user is assigned to or from AMStoreConnection you can do a getTopLevelContainers to get the orgs, roles etc assigned for the signed in user ..
take a look at the identity server samples it should be in
/install_dir/SUNWam/samples/sdk
HTH .. -
WebCenter user role not getting propagated
Hi,
I am creating a WebCenter WSRP portlet application. I expected, after registering the application as a portlet, when I will consume it in WebCenter, the currently logged in user's name and role will be accessible. But in my case, when I am trying to check the logged in user's role using request.isUserInRole(...) method, it always return false. When I debugged the application, I saw that the user role is empty.
Can someone please help me understand, if I have to do anything to successfully propagate the logged user's role to the custom portlet application.
Just so you know, I could access the logged in user's name using request.getUserPrincipal().getName(). Please help.
Thank you,
Kanchan UpadhyayHi,
Yes, I am using LDAP and everything else in webcenter works fine. Just the user role is not getting propagated to my custom application developed using portlet. I have tried in taskflow also, seems like the user role is not accessible from there as well. Is there any specific way of accessing user information for custom application hosted in webcenter as portlets?
Your help is appreciated!!
Thank you,
Kanchan -
Get authorization data by passing user role
Hi All,
Can anybody please tel me to retrieve user authorization data if i pass user role i want to get whole authorization data for that role.
Thanks,I am not sure about the authorization objects/values for a given role, but you can get that for a user using the FM SUSR_USER_AUTH_FOR_OBJ_GET.
-
To get the Roles, Worksets, iviews assigned to portal user using webdynpro
Hi..
I need to display the roles, worksets, pages and iviews that are assigned to a particular portal user using WebDynpro.
I tried to search in SDN and found a few blogs on this... but all are for DynPages. I could not find any inputs on how to achieve this in Webdynpro.
I am listing down the blogs for your reference :
1) /people/prakash.singh4/blog/2005/07/28/browse-roles-folders-pages-iviews-assigned-to-a-user-ep6-sp9-and-higher
2) /people/prakash.singh4/blog/2005/09/06/create-a-sitemap-for-your-portal
Please provide me your suggestions on how to display the roles, worksets, pages and iviews that are assigned to a particular portal user using WebDynpro.
Thanks and Regards,
Sayan GhoshPlease use following code to get all roles assigned to user:
IWDClientUser wdUser = WDClientUser.forceLoggedInClientUser();
IUser user = wdUser.getSAPUser();
String strRoleID = "", strRoleDesc = "";
IRoleFactory iRoleFactory;
iRoleFactory = UMFactory.getRoleFactory();
// Get All the Roles of the User
Iterator iteratorRoles = user.getRoles(true);//prtRequest.getUser().getRoles(true);
// Loop through all the Roles
while(iteratorRoles.hasNext())
strRoleID = iteratorRoles.next().toString();
try
strRoleDesc = iRoleFactory.getRole(strRoleID).getDescription();
wdComponentAPI.getMessageManager().reportSuccess("Role: "+strRoleDesc);
catch(Exception e)
wdComponentAPI.getMessageManager().reportException("Exception e: "+e, false); -
Get user and user-roles in form based authentication
How do I get user and roles associated with the user in my bean for "form based authentication".
regards,
nirvan.HttpServletRequest#getUserPrincipal().
This has nothing to do with JSF. Form based authentication is part of Servlet spec.
In JSF you can get the HttpServletRequest by ExternalContext#getRequest().
Maybe you are looking for
-
Transportation - Diferenu00E7a em custo de frete.
Tenho um tipo de transporte que faze três paradas, da usina para um deposito(Deposito não emite nota fiscal), desse deposito vai para um segundo deposito(Que também não emite nota fiscal), saindo do segundo deposito o material é direcionado ao porto
-
How do i sync ical with my other computer
I need to sync iCal on my two mac computers and am not sure how to do it.
-
How About Some Standard Standards For Keyword Hierarchy?
After reading Wolf Eilers post in the "Respect Keyword Hierarchy when importing" thread, I tried his example and exported a RAW file with the "Outdoor>Landscape" example he gave and then re-imported the jpeg. It came back in with Landscape as the par
-
Failed to fetch dNIPDNSZones from DNS_LOCATOR_OBJECT
I am unable to provision DSfW after installing it. The Provisioning PreCheck is successful, but the Configure DNS portion fails. It looks to me as though the installation did not create a DNS Locator object in eDirectory. It seems as though we had so
-
Two 23" Cinemas and only one...
I just placed two 23" Cinemas on my Mac Pro. I noticed that the keyboard screen controls only seem to work in "mirrored" mode, which I don't ever use. I found a little utility called appropriately, "Brightness Control" which works great, but it seems