<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Fetching roles from the table in Application Development and Automation Discussions</title>
    <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-roles-from-the-table/m-p/5755165#M1303864</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rajeev&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally you would check the authorization for an AUTH object contained within this z-role.&lt;/P&gt;&lt;P&gt;However, if you want to particularly check for a role assignment you could use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;BAPI_USER_GET_DETAIL&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to read the role assignment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to implement this in a more general way you may create a function module or class containing a method where the interface looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ID_ROLE (IMPORTING parameter)
RD_SUBRC (RETURNING parameter) or raise an exception&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the fm or method you call the BAPI and check for the required role assigment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 27 May 2009 20:53:20 GMT</pubDate>
    <dc:creator>uwe_schieferstein</dc:creator>
    <dc:date>2009-05-27T20:53:20Z</dc:date>
    <item>
      <title>Fetching roles from the table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-roles-from-the-table/m-p/5755164#M1303863</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am working on an issue ... where I have to restrict a user to execute a set of code based on his role, so basically what I need to look out for the role of  user from table agr_users... and if the user falls in a particular role ..let's say ztest_role then he shouldn't have the right to execute the code and should exit out but otherwise he should be able to do that. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Can you please help me with this. &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks, &lt;/P&gt;&lt;P&gt;Rajeev&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 20:25:02 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-roles-from-the-table/m-p/5755164#M1303863</guid>
      <dc:creator>Former Member</dc:creator>
      <dc:date>2009-05-27T20:25:02Z</dc:date>
    </item>
    <item>
      <title>Re: Fetching roles from the table</title>
      <link>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-roles-from-the-table/m-p/5755165#M1303864</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Rajeev&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Normally you would check the authorization for an AUTH object contained within this z-role.&lt;/P&gt;&lt;P&gt;However, if you want to particularly check for a role assignment you could use&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;BAPI_USER_GET_DETAIL&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;to read the role assignment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;In order to implement this in a more general way you may create a function module or class containing a method where the interface looks like this:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE&gt;&lt;CODE&gt;ID_ROLE (IMPORTING parameter)
RD_SUBRC (RETURNING parameter) or raise an exception&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Within the fm or method you call the BAPI and check for the required role assigment.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;  Uwe&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 27 May 2009 20:53:20 GMT</pubDate>
      <guid>https://community.sap.com/t5/application-development-and-automation-discussions/fetching-roles-from-the-table/m-p/5755165#M1303864</guid>
      <dc:creator>uwe_schieferstein</dc:creator>
      <dc:date>2009-05-27T20:53:20Z</dc:date>
    </item>
  </channel>
</rss>

