Roles retrieval
Hi,
I am trying to retrieve the Roles that I have created in
Weblogic console Securityrealms->myrealm->Globalrole->roles from a page flow using userInfoControl.getAvailableUserRoles(getRequest()).(weblogic 9.2)But I get only the anonymous role.
If I give the access to 'everyone' to any role I can see that and if I give teh access of the role to a group/user name I dont se that Role.
is there any way to get all the roles that I have created under the global roles.
I have been working on this since a long time..:(
I have also done this:
GlobalRoleResource resource = new GlobalRoleResource(entAppName,webAppName,EntitlementConstants.P13N_ROLE_POLICY_POOL,"");
But not getting any output....
Thanks.
Edited by srilkrishna at 03/21/2007 4:45 AM
Sri -
I have forwarded your problem to a developer who will try to reproduce your problem. The UserInfoControl code should have worked, at first glance, so we're investigating a bit more. Hope to have an answer for you by COB today MST.
Similar Messages
-
Problem mapping LoginModule roles to ejb security roles
I have "successfully" managed to implement the DBSystemLoginModule. When I run my application I successfully authenticate to the database, the login module successfully retrieves the users roles from the database and adds them to the subject:
PassiveCallbackHandler cbh = new PassiveCallbackHandler(username, password);
LoginContext lc = new LoginContext("current-workspace-app", cbh);
lc.login();
I then perform a lookup on a bean using the same user:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, "oracle.j2ee.rmi.RMIInitialContextFactory");
env.put("java.naming.security.principal",username);
env.put("java.naming.security.credentials",password);
env.put("java.naming.provider.url", "ormi://localhost:23891/current-workspace-app");
Context ic = new InitialContext(env);
final SessionEJBHome sessionEJBHome =
(SessionEJBHome) PortableRemoteObject.narrow( ic.lookup( "SessionEJB" ), SessionEJBHome.class );
Finally, I create an instance of the bean and call a method of this bean.
SessionEJB sessionEJB;
sessionEJB = sessionEJBHome.create( );
sessionEJB.testMe( );
I am expecting (hoping) that the roles retrieved from the database by the login module may be used to authenticate the ejb methods. i.e. if (in ejb-jar.xml) the method "testMe" has a method-permission with role-name of "ABC" then this method may only be accessed if the user is a member of the "ABC" role retrieved from the database by the login module. However I get the message:
"username is not allowed to call this EJB method"
When I add a security-role-mapping in orion-ejb-jar.xml mapping the role "ABC" to the group "ABC" (and impliesALL="true") then the method is called successfully. However, if I add a security-role-mapping mapping the role "DEF" to the group "DEF" (which the user is not a member of) the ejb method is (wrongly) called successfully (with implies all="false" the method always fails). In other words there seems to be no mapping of the roles retrieved by the login module to the ejb security roles.
Can anyone please enlighten me on how I can achieve the mapping of the ejb security roles to the roles obtained from the login module.
Thanks
PS I have this problem with JDeveloper 10.1.3 (Developer Preview 10.1.3.0.2.223 and Early Access 10.1.3.0.3.3412)Hi Sebastian,
yes, it is possible to do such mapping. And here how it works:
1. define security roles in the ejb-jar.xml within the <security-role>. For example:
<security-role>
<role-name>test</role-name>
</security-role>
2. then you map the roles those roles to server security roles using the <security-role-map> tag of the ejb-j2ee-engine.xml descriptor.
<security-permission>
<security-role-map>
<role-name>test</role-name>
<server-role-name>myUMErole</server-role-name>
</security-role-map>
</security-permission>
the myUMErole must be defined in the UME!
Does this answer your question? -
Debug cloud service in emulator
Hi:
I have an Azure web site that calls a cloud service. The cloud service places a request on an Azure storage-based queue. Then a web role retrieves the request from the queue, and does its work. This all works great when deployed to Azure,
but I want to debug everything locally in the emulator. The problem I am having is that I can't figure out how to make the local service run in the emulator. In the .svc.cs file, with the following line of code:
CloudStorageAccount sa = CloudStorageAccount.Parse(
RoleEnvironment.GetConfigurationSettingValue( "DataConnectionString" ) );
theGetConfigurationSettingValue() call returns a 'System.Runtime.InteropServices.SEHException' exception. If I include a RoleEnvironment.IsAvailable call, it returns false regardless of what I set as the service as the startup project.
So the service is running, and my web role can call it, but evidently the service is not running in the emulator. How can I fix this?
Thanks in advance,
Terry
TerryLDear Terry,
The error 'System.Runtime.InteropServices.SEHException' means you attempted to access the RoleEnvironment without running in the dev fabric or Azure fabric. In general, this may because
you didn't set cloud project as a startup project, just as VIJAYAMANIKANDAN said. Your application was running in the emulator but didn’t work, this was very strange, and thus it is hard for us to reproduce this issue.
By the way, thank you for sharing another method to us, I will mark the above post as the answer.
If you have any other issues, please feel free to ask.
Best Regards
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey. -
Can anyone guide me about this kind of error?
Hello,
Seems today is the day of errors for me. Few hours back had an silly error with servlets, now its EJB :-).
M having a web application in struts with EJB3.0. the error i'm getting is :-
[[action]] Servlet.service() for servlet action threw exception
javax.ejb.EJBException: null; CausedByException is:
null
at org.jboss.ejb3.tx.Ejb3TxPolicy.handleExceptionInOurTx(Ejb3TxPolicy.java:46)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:70)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:152)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:60)
at $Proxy183.login(Unknown Source)
at com.java.action.LoginAction.doLogin(LoginAction.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
at com.java.business.common.helper.SecurityManagerHelper.getUserSecurityProfile(SecurityManagerHelper.java:24)
at com.java.business.common.SecurityManagerBean.login(SecurityManagerBean.java:15)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:99)
at org.jboss.ejb3.AllowedOperationsInterceptor.invoke(AllowedOperationsInterceptor.java:32)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.aspects.tx.TxPolicy.invokeInOurTx(TxPolicy.java:66)
at org.jboss.aspects.tx.TxInterceptor$Required.invoke(TxInterceptor.java:134)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.aspects.tx.TxPropagationInterceptor.invoke(TxPropagationInterceptor.java:61)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.ejb3.stateless.StatelessInstanceInterceptor.invoke(StatelessInstanceInterceptor.java:39)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.aspects.security.AuthenticationInterceptor.invoke(AuthenticationInterceptor.java:63)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.ejb3.asynchronous.AsynchronousInterceptor.invoke(AsynchronousInterceptor.java:91)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:88)
at org.jboss.ejb3.stateless.StatelessContainer.localInvoke(StatelessContainer.java:152)
at org.jboss.ejb3.stateless.StatelessLocalProxy.invoke(StatelessLocalProxy.java:60)
at $Proxy183.login(Unknown Source)
at com.java.action.LoginAction.doLogin(LoginAction.java:48)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.struts.actions.DispatchAction.dispatchMethod(DispatchAction.java:274)
at org.apache.struts.actions.DispatchAction.execute(DispatchAction.java:194)
at org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:419)
at org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:224)
at org.apache.struts.action.ActionServlet.process(ActionServlet.java:1194)
at org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:432)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:252)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:202)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:173)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:213)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:178)
at org.jboss.web.tomcat.security.CustomPrincipalValve.invoke(CustomPrincipalValve.java:39)
at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:153)
at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:59)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:126)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:105)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:107)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:148)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:856)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:744)
at org.apache.tomcat.util.net.PoolTcpEndpoint.processSocket(PoolTcpEndpoint.java:527)
at org.apache.tomcat.util.net.MasterSlaveWorkerThread.run(MasterSlaveWorkerThread.java:112)
at java.lang.Thread.run(Unknown Source)
================================
what's this "javax.ejb.EJBException: null; CausedByException is: null" exception ? and how to solve this one? only thing i cud understand is my app or Ejb is seeing something null. The line where i'm getting this error in SecurityManagerHelper.java is the code where i'm trying to set the UserName retrieved from database. m posting the parts of code revelent to error here:-
LoginAction.java(Action class)
userSecurityProfile = (UserSecurityProfile)this.getSecurityManagerObject().login(userVO);
SecurityManagerBean.java(Bean Class)
package com.java.business.common;
import javax.ejb.Stateless;
import com.java.business.common.helper.SecurityManagerHelper;
import com.java.dao.Authenticate;
import com.java.dto.usermanagement.UserSecurityProfile;
import com.java.dto.usermanagement.UserVO;
@Stateless
public class SecurityManagerBean implements SecurityManager {
public UserSecurityProfile login(UserVO userVO) throws Exception {
return SecurityManagerHelper.getUserSecurityProfile(Authenticate.getAuth(userVO)); //line 15
SecurityManagerHelper.java(in this class i'm trying to set username and role retrieved frm data base and is stored in ArrayList to another class calles UserSecurityProfile)
userSecurtyProfile.setStrUserName((String)alUserInfo.get(index)); //this is line 24
plz help me out this error.problem sorted out. Thanx for putting an eye here :-)
-
Business Case :ABAP APIs in SAP MDM
SDNers,
Kindly share your views on Business-case application(s) of ABAP APIs fron the perspective of SAP Master Data Managment.
Regards,
KAVHi krutarth,
ABAP API (Application programming interface) are interface programming written in R/3 system to manage MDM activies through R/3. or
The MDM ABAP API empowers ABAP-based applications to control MDM Servers using most of the functions available in the MDM Console and MDM Data Manager
applications.
1) It enables an R/3 system to access the administrative
functionalities of the MDM Server.
For E.g.
Create repository,
Connect to repository,
Load repository,
Create role,
Create user
Retrieve roles,
Retrieve users
Create client system
Retrieve client systems
Retrieve tables
-Retrieve table fields
Activate trace
2)It also enables R/3 system to access the data processing**
*functions of the MDM Server.*For e.g.
Create a transformation
Retrieve a transformation
Create rules
Retrieve rules
Create a strategy
Retrieve a strategy
Invoke matching
Invoke a matching value check
Retrieve a matching result
and many more.
If u find this helpful then do reward points.
Regards,
Neethu Joy.
Edited by: Neethu joy on Feb 29, 2008 9:01 AM -
Hello,
I am using Struts Menus, which print out menu and menu items based on user's roles, retrieved by request.UserInRole(). I am using Jboss as my app server and I am using LDAPModule for Security but I can't seem to get it to work. I get a j_security_check not found at log in.
What I have done so far is
1. Modified the login-config.xml (in server/default/conf) to add
<application-policy name="security">
<login-module code="org.jboss.security.auth.spi.LdapLoginModule" flag="required">
... all optional LDAP attributes...
</login-module>
2. Added the following line in jboss-web
<jboss-web>
<security-domain>java:/jaas/security</security-domain>
</jboss-web.xml>
Am I missing something else?
Thanks again!Hello,
I am using Struts Menus, which print out menu and menu
items based on user's roles, retrieved by
request.UserInRole(). I am using Jboss as my app
server and I am using LDAPModule for Security but I
can't seem to get it to work. I get a j_security_check
not found at log in.
What I have done so far is
1. Modified the login-config.xml (in
server/default/conf) to add
<application-policy name="security">
<login-module
code="org.jboss.security.auth.spi.LdapLoginModule"
flag="required">
... all optional LDAP attributes...
</login-module>
2. Added the following line in jboss-web
<jboss-web>
<security-domain>java:/jaas/security</security-domain>
</jboss-web>
Am I missing something else?
Thanks again!3. Add the following line in jboss.xml -
Re: Retrieve user role using Java
Dear all,
I have defined a role, says "Operator" in the Sun one Server. I tried to write a Java program to retrieve the role for my web application, but not successful. It only displayed the attribtues shown in Custom Editor such as givenName, cn and etc. But the attribute "nsrole" was shown in Generic Editor which I cannot retrieve in the Java Program.
How can I retrieve it using Java Program with using standard Java API only?
Regards,
CalvinThat attribute is an operational attribute. You must specify it in the list of attributes to retrieve in your search command.
-
Retrieve Members of Role in BPM 11g
Hi All
is there a way to retrieve users/groups assigned to a BPM process role?
Does getUsersInAppRole retrieves both users and group?
How can we convert the result of above function into a delimited string?
Pls help.....Look for postings/replies of user "steve_adler"
In one of his posts about paging and range Ldap Queries he explains how to find all members of a group. -
Retrieve ejb security roles list
Hi,
in a EJB stateless session bean is it possible to retrieve, by EJB context, the list of configured roles related to the current user?
Thanks in advance.
bye
RobBased on the link given here is the xml. This XML already exists in the application and has such structure
<security-permission>
<security-role-map>
<role-name>developer</role-name>
<server-role-name>role1</server-role-name>
<server-role-name>role2</server-role-name>
<server-role-name>role3</server-role-name>
<server-role-name>role4</server-role-name>
<server-role-name>role5</server-role-name>
</security-role-map>
</security-permission>
My question is, which of the following annotation will work:
@RolesAllowed(value=)
or
@RolesAllowed(value=) //currently I am using this.
Edited by: Arpit Goyal on Feb 27, 2009 4:39 AM -
Retrieve role-activity relationship via papiws
We have a demand from a client who is asking for access the information about the audit trail activities and the role which those activities are associated in an external application.
We’re using PAPIWS’ method processGetVisibleActivities(String) from the WebService, but it only lists information about interactive activities from a process.
I would like to know if there’s a way to retrieve, via Webservice, all activities, like Begin, automatic acitivities and decisions.Hi,
can you look at this
[https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/a92195a9-0b01-0010-909c-f330ea4a585c?overridelayout=true]
Regards,
Muralidhar -
Retrieving EP roles from web dynpro
Hello
I'm sure this is a common problem but I've checked all the older posts and I just can't get it working.
We have a web dynpro app that runs within an EP iView (EP6SP14), and we need to retrieve the portal roles for the user.
With the APIs (using IRole and IUser and the getRoles() method) we only get the J2EE roles. These are not the same.
Can anyone help?
Thanks
ChrisHi Chris,
have you tried to read the groups of your user? As far as i know, the roles from EP are mapped to the groups in J2EE.
Try something like this:
IWDClientUser user = WDClientUser.getCurrentUser();
Iterator groups = user.getSAPUser().getParentGroups(false);
while (groups.hasNext()) {
String bez = UMFactory.getGroupFactory().getGroup((String) groups.next()).getDisplayName();
// bez contains your roles (groups)
i hope that helps
regards
ingo -
What is data base interface and the role it will play while retrieving data
What is data base interface and the role it will play while retrieving data.
Hi,
check out the following link.
http://help.sap.com/saphelp_nw04s/helpdata/en/97/68d64260752a78e10000000a155106/frameset.htm
it says:
Database Interface
Interface to the database of the NetWeaver AS ABAP that is integrated in the ABAP-runtime environment. The statements of Open SQL and Native SQL access the database using the database interface. The database interface is responsible for data transport between business layer and persistence layer, automatic client handling, and SAP buffering.
hope it helps.
Regards,
kinshuk -
How to retrieve Process Role Name
Hi @ all,
can anyone tell me how to retrieve the Name of the actual processing Role in a web dynpro callable object.
Until now I just found out how to get the technical name in the execute() method. Unfortunately it's not the human readable name.
e.g.
String name = executionContext.getProcessRoleInstance().getProcessRoleTechName();
Thanks and Regards
RobertHi Robert,
After you created a process, block, action, and your WD GP interface callable object and would retrieve this information in custom way you can use the following coding:
<code>
String processId = executionContext.getProcessId() ;
IGPRuntimeManager runtimeManager = GPProcessFactory.getRuntimeManager() ;
IGPProcessInstance process = runtimeManager.getProcessInstance(processId, getCurrentUser()) ;
IGPProcess processTemplate = (IGPProcess)process.getTemplate() ;
int gpRolesSize = processTemplate.getRoleInfoCount() ;
String roleDisplayName = null ;
for (int i = 0; i < gpRolesSize; i++)
IGPRoleInfo role = processTemplate.getRoleInfo(i) ; if (role.getRoleName().equals(roleTechName))
roleDisplayName = role.getText()
break ;
</code>
Best regards,
Aliaskei -
Hi,
I created new bp in t-code: bp, I would like to know Function Module that retrieve the role of new bp.
My requiremment is want to check role of bp before saving new bp. If it is Business Partner(General), then cannot save.
Thanks in advance.Hi,
Thanks for giving fm. It works!!
I have developed new fm by adding this fm into bus7> DCHCK , but I have some issues.
When I created new bp and did not select any roles (default is 000000 business partner),
it can't be saved(That's requirement). Then it cannot be changed or do anything except cancel(F12).
, so I have to cancel this screen. Is there any fm or code to continue creating BP?
Thanks in advance. -
Retrieving Entry Point =True,Roles programatically and retrieving their URL
Hi Team,
I want to retrieve the roles whose entry point is equal to true using WebDynpro, And display their names.
When i am trying to display any role name it is displaying with underscores, like if it is content administration role it is displaying like content_admin_role.
I want it to display it just similar name which will display in portal, like content administration how can i do this?
And for each and every role i want to bring the role URL correspond to it.
I tried this and reached upto some extent but not able to open the role perfectly.
I used the below code for getting the names of the roles.
Iterator rit = null;
try
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);
wdComponentAPI.getMessageManager().reportSuccess("Role names1..."+role.getDisplayName().toString());
wdComponentAPI.getMessageManager().reportSuccess("Role names2..."+role.getUniqueName().toString());
//wdComponentAPI.getMessageManager().reportSuccess("Role names3..."+rfact.getRolesOfUser(unique,true));
Also suggest me to retrieve the URL's of respective roles, and it should navigate to that perticular role when i open that URL in browser.
Thanks in advance.
BalaHi,
First of all you want to distinguish the pcd roles from the LDAP roles. To do that you use a IRoleSearchFilter like this:
IRoleSearchFilter searchFilter = null;
try {
searchFilter = roleFact.getRoleSearchFilter();
searchFilter.setDisplayName("*", SearchAttribute.LIKE_OPERATOR, false);
ISearchResult result = roleFact.searchRoles(searchFilter);
if (result.getState() == ISearchResult.SEARCH_RESULT_OK) {
while (result.hasNext()) {
String RoleName = (String) result.next();
IRole role = roleFact.getRole(RoleName);
You also need to check if the role is assigned to the user, so get the user's roles and compare them to the ones you got from the search result.
In order to get name correctly use:
role.getDescription();
To see if Entry Point = True you do something like this:
IPcdContext targetobject =(IPcdContext) initialContext.lookup(role.getUniqueName());
Object object = targetobject.getAttributes("").get("com.sap.portal.pcd.role.EntryPoint");
if (object instanceof IPcdAttribute) {
IPcdAttribute att = (IPcdAttribute) object;
boolean b = att.getBoolean();
To get the URL of the role you should use:
string RoleUrl = "http://<server>:<port>/irj/portal?NavigationTarget=ROLES://" + role.getUniqueName().substring(4);
Best regards,
Avishai Zamir
Maybe you are looking for
-
When I check for software updates only itunes and random other updates show up but not security updates or safari update. When i check installed updates I realized my last security update was 2011-004 and I still have safari 5.0.6. Can anyone help me
-
IPhone 4s iOS 5.1 update, iMessage- my contact is coming up as my apple ID
I updated my iphone 4s to ios 5.1 last night and then today when I texted someone else with an iPhone using iMessage, my contact came up as my Apple ID email on their phone instead of my name that was associated with my phone number. This obviously c
-
How can I cut/paste/save Desktop Nature Preinstalled Photos
I really like some of the pre-installed photos that exist in System Preferences for Desktop choices...and am trying to figure out if I can save them to iphoto or cut and paste them elsewhere....When I tried, I couldnt figure it out. basically, when y
-
Dynamically assign Search Help to the field
Hi All, I have creates one search help from se11 like zshlp. i m not assign this search help to the database field. bocz i used this search help at runtime. so how can i assign this search help during execution time of my program. Reward for helpful
-
Hey guys, What's up?! I'm just wondering if I could change my alarm tone to my own mp3? Thanks people!