Getting Roles
Dear Friends..
How I can get from BPM Studio all roles?
I wrote this code:
Role oRoles;
oRoles = new Role("Client");
for (Participant element : oRoles.participants) {
// some code...
With this code, I get Role's participants , but how I can get Roles?
I hope any suggestions.
Best regards,
Danny
Hi Danny,
Even though it's PAPI, you can run this logic from a method inside your process since it's using the Fuego.Papi module in the catalog.
This gets all the roles in the processes deployed. Another approach would be to pass this method an array with just the names of the specific processes you want to retrieve the roles for.
ps as ProcessService
rolesInAllProcesses as String[]
do
connectTo(ps, url : Fuego.Server.directoryURL, user : "papiUser", password : "papiUser")
for each prc in ps.processes do
for each r in prc.roles do
// don't add the same role twice
if r !in rolesInAllProcesses then
logMessage "found: " + r
rolesInAllProcesses[] = r
end
end
end
// sort the pup
sort rolesInAllProcesses
on exit
disconnectFrom ps
endHope this helps,
Dan
Similar Messages
-
How can I get roles by BEA API
I use some bea api and create one role name is "test",I add one user and one group in it.
but I input resourceId is "test",no results display,whether I use wrong?please tell me how can I get roles by bea api
some code ,for example
public RoleProviderDescription getRoleDefaultProvider() throws ProviderMgmtException
RoleProviderDescription roleProviderDescription = RoleSecurityMgmtHelper.getDefaultProvider();
return roleProviderDescription;
public RoleManagerProxy getRoleManagerProxy()
RoleManagerProxy roleManagerProxy = new RoleManagerProxy(getRoleDefaultProvider());
return roleManagerProxy;
public List<String> getRoles(String resourceId)
String[] roles = getRoleManagerProxy().listRolesForResource(resourceId);
List<String> list = new ArrayList<String>(roles.length);
for(int i=0; i<roles.length; i++)
list.add(i, roles);
return list;*{color:#0000ff}Alternatively you can try this one too:{color}*
public static Object[][] listRolesForResource(int aResourceScope,String anEntAppName,String aWebAppName,String aResourceId)
{color:#800000}
Other than this if you are trying to access the roles within a portal context there is a control called DelegatedRolePolicyManagerControlFacade (com.bea.portal.tools.entitlements.controls.DelegatedRolePolicyManagerControlFacade) which can give you all the roles:
Here is the sample code (within a pageflow action):
@Control
private DelegatedRolePolicyManagerControlFacade rolePolicyManagerCtrl;
ResourceContext context = ResourceContext.createResourceContext(request, false);
SortablePagedResult<String> result = rolePolicyManagerCtrl.getScopedRoles(null, null, null, false, -1, context);{color}
Edited by: user5833069 on Jan 7, 2009 10:08 AM
Edited by: user5833069 on Jan 7, 2009 11:38 AM -
How to get role check in web dynpro abap
Hi,
I am creating an web dynpro application and i need to perform certain functions based on the verification of role name .
To the users which are been assigned to the particular role only they can perform the desired application.
But i dont know what condition should be given in order to get the role name from the sap gui as well as from the netweaver portal.
I would also like to ask how can we import the roles from netweaver portal to sap gui or how can we set authorisations on those roles which are been created in netweaver portalHi,
There is no support for using portal API to get the roles in webdynpro ABAP.
So the best way to achieve this would be create an iview for your webdynpro ABAP application and control the user access by assigning them permission and placing the content in "Security zones" which makes the content non-accessible to the user if he is assigned with the role and intill he has required zone assigned to him.
Thanks & Regards,
Lokesh Kamana -
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. -
Getting Roles & Participants Dynamically in BPM
Hi,
I am trying to get the roles and particiants from external resources such as LDAP. Is there aby way to connect BPM to LDAP and retrieve the users & roles.
Thanks,
Sanjay
Edited by: Sanjay_21 on Aug 24, 2009 10:47 AMSanjay,
You can do this in BPM Enterprise. You have to configure a "hybrid" directory. The default is to store all the information of your organization in a database. With a hybrid configuration this will come from an LDAP.
You can read a bit about it in the docs:
http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/admin_guide/modules/dir_service/c_Hybrid_Directory_Service.html
http://download.oracle.com/docs/cd/E13154_01/bpm/docs65/admin_guide/modules/dir_service/t_Config_Hybrid_Dir_Service.html
Inside the directory $BPM_HOME/conf you can find some configuration files for integrating with an LDAP:
generic_sunone.conf
generic_oracleldap.conf
Here you can specify how to find the participants and groups in your LDAP.
And then in your code you would search for them in the same way as always:
Participant.find("p1")
Role.find("r1") -
SJWS 6.1 Policy Agent getting roles
Hi,
I've installed Policy Agent 2.2 in SJWS 6.1 and authentication is working properly. I've configured nativeRealm to get the user's principal from a web application (a servlet).
In this scenarios the user has two roles (it's working on WebLogic 8.1), but the Agent doesn't receive this roles from server, and in servlet the call to the function isUserInRoles doesn't work.
Anybody knows if is it possible working with roles, using J2EE security in servlets, with Sun Java WebServer 6.1 using Policy Agent 2.2 with Access Manager?
Thanks a lot
DavidHave you also tried not to set JAVAHOME at all as mentioned in the docs?
-Bernhard -
Get Role,Group based on Username in webdynpro NOT Portal
public static void wdDoModifyView(IPrivateFormView wdThis, IPrivateFormView.IContextNode wdContext, com.sap.tc.webdynpro.progmodel.api.IWDView view, boolean firstTime)
//@@begin wdDoModifyView
try {
IWDClientUser user = WDClientUser.getCurrentUser();
String userinfo=user.getClientUserID();
String userinfo1=user.getFirstName();
String userinfo2=user.getLastName();
} catch (WDUMException e) {
e.printStackTrace();
//@@end
It works fine for this code, but what i need is based on the current login name i am to check the associated userrole and group it belongs to
do i able to do that ?
this code is implemented in webdynpro not portals...
when i place this code in webdynpro implementation section ,
it is a big disaster for me showing error,
i can used : request , response
IUser user=request.getUser();
Iterator roles=user.getRoles(true);
while(roles.hasNext()){
String uniqueID=roles.next().toString();
IRole userRole=UMFactory.getRoleFactory().getRole(uniqueID);
response.write("Role is:" +userRole.getDisplayName());
}catch(Exception e){
response.write("" +e);
where this code should implement actually.....i am a beginner...hi
Check out this threads
/thread/201169 [original link is broken]
/message/1565111#1565111 [original link is broken]
Get portal user details in WebDynpro
When using the IUser API add the <b>security</b> jar file to the project by righclick on project->properties->javabuildpath->addexternalJars
Regards,
Gopi -
How can I get role configuration key in an abap program?
Hello there!
In a abap program I would like to get which configuration key it is running.
The idea is, our abap program will decide which instruction execute depend on the current configuration key, but, we donu2019t know how to get this information.
Does anybody know a BAPI, BADI or something like that to do this?
Regards,
LaercioHi,
Threre is no standard API provided for this however you can use following code snippet do get your jobe done.
data: LV_PROFILE type ref to IF_CRM_UI_PROFILE.
data: LV_ROLE type string.
LV_PROFILE = CL_CRM_UI_PROFILE=>GET_INSTANCE( ).
if LV_PROFILE is bound.
LV_ROLE = LV_PROFILE->GET_PROFILE( ).
endif.
Now, the LV_ROLE will contain the ID of the Business Role.
If you're interested in the role config key you might add the following lines of code.
if LV_PROFILE is bound.
RV_RESULT = LV_PROFILE->GET_COMPONENT_PROFILE(
CL_CRM_UI_PROFILE_ROLE_CONFIG=>GC_PROFILE_ID ).
endif. -
Getting roles assigned to a user in OIM
We need to write a query to find what are the roles assigned to a particular user and when it has been assigned , is there any source where the OIM tables and their attributes have been explained? We were referring the UPA_GRP_MEMBERSHIP for getting the roles( referring UGP_KEY) and the user with (UPA_USR_KEY), is this correct or is there some other table which has the info?
Thanks for your reply...
To getting the roles of a user, what is the common attribute between USR and UPA_GRP_MEMBERSHIP table? Is it usr_key from usr table and upa_usr_key from UPA_GRP_MEMBERSHIP? if not, what are the differences between the two attributes and is there any other attribute to refer ? -
How to get role list which has a particular infoobject
hi all,
i need to find the list of all roles in LIVE system where a particular infoobject is used and its respective value stored in that role.
because we have some 100 roles totally, and is cumbersome to check each role in PFCG manually.
is there any table / any other way to get this list?Hello,
I believe you can find that on the table AGR_1251
Hope this helps,
Regards,
Diogo. -
Getting roles in encrypted format
Hi,
I am trying to read all the roles present in WAS through a EJB. Somehow the return values for roles (the ones created by a user) I am fetching are in encrypted format (here the roles which were created at the time of installation can be seen properly)
I searched for the roles through useradmin and I can see the roles perfectly normally.
Can anyone tell me what is happening here? and what can be done to resolve the issue?
Thanks in advance,
NakulHi ,
I think if you are looking for integrating Excel to XI, then I will suggest to not consider the my above post.
I am sorry for the confusion. I am interpreted it as xml .....
Please refer below post for Excel to XI
Read Excel instead of XML through FileAdapter
/people/sap.user72/blog/2005/07/04/read-excel-instead-of-xml-through-fileadapter
SAP Network Blog: eMail Report as Attachment (Excel/Word)
/people/community.user/blog/2006/09/08/email-report-as-attachment-excelword
SAP Network Blog: XI: Generating Excel files without the Java nor the Conversion agent not possible?
/people/michal.krawczyk2/blog/2005/12/10/xi-generating-excel-files-without-the-java-nor-the-conversion-agent-not-possible
SAP Network Blog: How to send any data (even binary) through XI, without using the Integration Repository
/people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
Thanks
Swarup -
Getting Roles assigned to Workset
How can you retrieve all the workset attached to a role?
Hi,
You can retrieve the roles assigned to user using the code below:
String userLogonID = "DUMMY_USER";
String userUniqueID;
try {
userUniqueID = UMFactory.getUserFactory().getUserByLogonID(userLogonID).getUniqueID();
} catch (UMException e) {
userUniqueID = null;
e.printStackTrace();
if (userUniqueID != null) {
IRoleFactory roleFactory = UMFactory.getRoleFactory();
String[] roles = roleFactory.getRolesOfUser(userUniqueID, true);
IRole role;
if (roles != null) {
for (int i=0; i<=roles.length; i++) {
try {
role = roleFactory.getRole(roles<i>);
//use IPcdContext to retrieve embedded context from the role
} catch (UMException e) {
e.printStackTrace();
Unfortunately Im not ready to provide an exact code for worksets retrieving right now, please review the following link to find out how to work with PcdContext:
PCD Object Properties
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/javadocs/nw04/sp12/pcd/com/sapportals/portal/pcd/gl/ipcdcontext.html
Thanks,
Yauheni. -
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 -
Help needed in getting the Role Description from BOL Entities
Hi All,
I am trying to retrieve BP Role and BP Role Description and display the details at the top of account over view page.
I am fetching the BP Role details using 'BuilRolesRel'. but i am not able to find any BOL Query to get Role Description.
Any pointers on this is really very very helpful.
Thanks,
UdayaHello Udaya,
under BuilRolesRel there is a entity BuilRoles and this entity has an Attribute RLCTITLE.
this is a Description of the role.
Good Luck
Eli Steklov
Please Reward Points if it Helped -
Hi EveryOne,
We are developing repository filter. Here we need to check roles of loged in user. How can we get role names in repository filter application?.
Thanks in advance,
Venkatesh.RHi Venkatesh
You can refer to your doubts in through the folowiing PDF
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/3641e490-0201-0010-c68f-e51221925714
http://help.sap.com/saphelp_nw2004s/helpdata/en/2b/306bb5bc98f24f8a85d489449af456/frameset.htm--
https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sapportals.km.docs/library/ep/_s-u/Using%20The%20New%20User%20Management%20API%20in%20EP%206.0
For getting Logged on user details
String presentuser=null;
IWDClientUser wdUser = WDClientUser.getCurrentUser();
IUser user = wdUser.getSAPUser();
presentuser=user.getUniqueID()
you will have to get com.sap.security.api.jar
(Path C:\Program Files\SAP\IDE\IDE70\eclipse\plugins\com.sap.security_2.0.0\lib\com.sap.security.api.jar. //// the path is the installed directory of NWDS )
Thanx
Pankaj
Maybe you are looking for
-
Cant uninstall firefox28 and reinstall firefox 30 -- why?
have had and loved firefox for years and loved it until recently.. firefox 28 now tells me to update "flashplayer" when i do this, 3 or 4 tabs open up and start downloading different things,,, "new player", "a repair tool", and a couple of other thin
-
Does the ApplTV2 support SNMP?
I have cacti running on my Mac Mini, and I've recently purchased an Apple TV. Is there a way to enable SNMP polling on the Apple TV? I'd love to see CPU/Memory/Interface statistics as I'm watching movies on it! Thanks.
-
Photoshop Elements 11 timing out
I am trying to download the trial version of PS11 hoever it keeps timing out about a third of the way through the download, I have tried several times and it fails approximately the same place each time, any ideas???
-
HiWe are facing problems with our outline as the figures don't seem to be correct.Our cube has 6 dimensions. Totequity( which is a parent)under one of the dimensions, should equal the sum of netincome, parentequity and consolidated equity (children).
-
I can't see or import media in media library panel.
Howdy, I'm sure this is the simplest thing ever and just a button, but my media is not showing up in the media library panel and when I try to drag and drop into to it I get the Ghostbusters red circle with the line. Any tips amigos? Thanks!