Determine if a user has access to a URL in a webApp?

Hello All.
I have created a WebApp and defined <security-constraint>'s in the
/WEB-INF/web.xml file, and all works fine.
However, I would like to enable/disable links on my User Interface based on
the current user's groups/roles and the <security-constraints>'s.
I can use the request.isUserInRole() method to determine if a user belongs
to a particular role.
However, what happens if the access to the URL changes in the web.xml file.
I need to programmatically determine which roles can access a URL defined in
the <security-constraint>.
Are there any weblogic classes that will assist in determining url patterns
and roles.
Any help would be greatly appreciated.
Thank you
Brad Hof

Bradley Hof wrote:
Hello All.
I have created a WebApp and defined <security-constraint>'s in the
/WEB-INF/web.xml file, and all works fine.
However, I would like to enable/disable links on my User Interface based on
the current user's groups/roles and the <security-constraints>'s.
I can use the request.isUserInRole() method to determine if a user belongs
to a particular role.
However, what happens if the access to the URL changes in the web.xml file.You can't redeploy webapps in WL 5.1 so this will never happen :)
Cheers,
Alex

Similar Messages

  • How to determine if a user has access to an item

    Without using the WWSEC_API, i need to find out if a user (not the logged in user) has the right privileges to view an item (url).
    Has anyone identified what tables are involved in determining if a user has access to view an item ?

    Create a vo with the following SQL passing userid as bind value:
    SELECT C.USER_NAME,
    B.RESPONSIBILITY_NAME,
    A.START_DATE,
    A.END_DATE
    FROM APPS.FND_USER_RESP_GROUPS_DIRECT A,
    APPS.FND_RESPONSIBILITY_TL B,
    APPS.FND_USER C
    WHERE C.USER_ID = A.USER_ID
    AND C.USER_NAME= :1
    AND B.RESPONSIBILITY_ID = A.RESPONSIBILITY_ID
    You will have the list of all the responsibilities of a user.
    Kristofer

  • How can I check if an user has access to an url within my web app?

    Hi,
    I have a web application where I allow the users to set their startup page by presenting them a list of startup pages. However, some startup pages can accessed only by certain users, so I want to present the user only those pages the user has access to.
    How can I do this with weblogic?
    One way is to read the web.xml file and determine the roles that have access to the page, then check whether the user has any of those roles.
    Is there a better way eventually using some weblogic api?
    Thanks

    Just for the record, I decided to parse the web.xml file and to simulate whatever the container does.

  • How do I get a list of the reports that a user has access to?

    <p>I need to be able to determine which reports a specified user has access to.  This is for an application where users will be able to search and view reports that have been archived through a separate process.  </p><p>I&#39;ve searched through the developer library, but I can&#39;t find this specific information.  Can I use the ObjectPrinicpals class to get this info?</p><p>Thanks!</p><p>-Dell<br /></p>

    Hi Robert!
    Yes, the presentation went well. It was a lot of fun to do and I had a great time at the conference.
    Your suggestion works great if I'm walking down through the reports looking to see who has access to them.Â
    However, I need to do this starting from the User object. When I use the ObjectPrincipals of the User, I get a list of the users who have the rights to modify the user. I did a lot of work on this last week and it boils down to I'm going to have to actually log in as the user (I can use trusted authentication to do this without having the user's password) and then run a query to select all of the reports in the system - this should give me just the reports that the user has access to. Not the most efficient way to get the data from my perspective, but it should work.
    This would be a great feature to have added to future versions of the SDK. I need it for a couple of purposes:
    1. To gather information to set up the security in my archive viewer application.
    2. For auditing purposes - we currently have only Professional licenses so I don't have access to the internal auditing functionality. Plus, I'm not sure that that includes the kind of info I'm looking for so I'm building an app that extracts information to XML which is then used by a couple of reports so that I can provide the audit info as needed.
    -Dell
    Â - A computer only does what you told it to, not what you thought you told it to!</p>

  • Getting list of tables the user has access to across different schemas.

    Hi,
    I have to get the list of tables that an User has access to. I tried the below code. It takes a very long time. Is there any way in which I can specify the user name and get all the tables that he has access to? I know that we can use dbMetadata.getTables api. But this returns the list of tables under the said schema. But I want the list of tables that the user has access including tables in other schema.
    In the below code, I am trying to get the tables for which USER_MICHAEL has access to.
    DatabaseMetaData dbMetadata = connection.getMetaData(); String userName = null; dbrs = dbMetadata.getTables(null,userName , "%", new String[] { "TABLE" }); dbrs=dbMetadata.getTablePrivileges("",userName,"%"); while (dbrs.next()) { String tableName = dbrs.getString("TABLE_NAME"); String schema = dbrs.getString("TABLE_SCHEM"); String privilege = dbrs.getString("PRIVILEGE"); String grantee = dbrs.getString("GRANTEE"); if(grantee!=null && grantee.equals("USER_MICHAEL")){       System.out.println("Schema---"+schema+" Table---"+tableName+"  Privilege----"+privilege+"  grantee---- "+grantee); } }

    That would be database dependent.
    Some engines have some system tables that together may be used to extract such information, others may not make it available at all outside closed APIs.

  • Getting list of reports a user has access to

    Hi,
    I'm new to BO and have been trying to figure out a way to get a list of reports a specific user has access to. In reading the documentation in the SDK it appears the only way to do this is to get a list of all reports, loop through them, getting the ObjectPrincipals, looping through that then checking if the objectPrincipal.Name == user.Title.
                foreach (InfoObject report in infoObjects)
                    SecurityInfo securityInfo = report.SecurityInfo;
                    ObjectPrincipals objectPrincipals = securityInfo.ObjectPrincipals;
                    foreach (ObjectPrincipal objectPrincipal in objectPrincipals)
                        if (objectPrincipal.Name != user.Title) continue;
                        if (!sortedList.Contains(report.ID))
                            sortedList.Add(report.ID, report.Title);
    This works, but takes over 90 seconds to generate the list of reports I want, as it is looping through all reports in the CMS (120). My logic is telling me there must be a better way to do this, I just haven't found the answer. It appears that calling securityInfo.ObjectPrincipals is what is taking the most time.
    Advice, thoughts, suggestions are all appreciated.
    Thanks
    James

    Ok, logging in as a user and getting a list of reports is working well and fast. But how would you recommend getting a list of all users and the reports they are assigned to. Is there a query for that using the relationship functions of Query Builder?
    Thanks
    James

  • Restricting user search to the communities the user has access to

    We want to be able to restrict our users to search within the community that user is in or to the communities that user has access to.
    A global portal search is not acceptable. Could someone help me with this. We are running portal 6.0sp1 on solaris.
    Thanks!
    Jamal Najmi

    Hi Jamal Najmi,
    If you have KD hierarchy based on community, then you develop a small search portlet using adaptive tags that will search only those folders in the KD.
    Hope this helps.
    Bharat

  • Maxl/esscmd to get list of applications/databases that user has access to

    Is there any maxl/esscmd to get the list of applications/databases that a user has access to?
    I know that LISTGROUPUSERS 'groupName' -- this list all users of a group.
    Can anyone help please?

    MaxL
    display privilege user SomeUser;

  • BO SDK Query to find all folders that a user has access to

    Hi Experts
    Please help me on BO SDK Query to "find all folders that a user has access in a single query".
    I am tried trial & error using PARENTS & CHILDREN. nothing worked
    Please advice
    Thanks!
    Prasath

    Hi Aasavari
    I am checking BO Web services samples and .NET samples. Please advice me the correct files to check the user/folder rights.
    Thank you so much
    Prasath
    http://wiki.sdn.sap.com/wiki/display/BOBJ/NETWebServicesSDKSamples

  • How do I test to see if a user has access on a site?

    I am completely new to PowerShell, but I have a requirement to build a PowerShell script that will run against a site, a set of sites or a web application. How do I add a check within my script to test if a user has rights on the site they are running it
    on or not? Am clueless on how to test if the user has rights to a site....I basically am trying to test, then let them know that they do not have access on a site or not. 
    How can I get this done? Please help.

    I now have this code which I think should do the trick, but I am getting an exception when i step through it. The $serverContext variable is always null. Does anyone know why I am getting this?
    write-host "Please enter the url of the site collection"
    $url = read-host
    write-host "Please enter the username of the user"
    $userName = read-host
    $site = New-Object Microsoft.SharePoint.SPSite($url)
    $serverContext = [Microsoft.Office.Server.ServerContext]::GetContext($site)
    $userProfileManager = New-Object Microsoft.Office.Server.UserProfiles.UserProfileManager($serverContext)
    $userProfile = $userProfileManager.GetUserProfile($userName)
    $userLogin = $userProfile[[Microsoft.Office.Server.UserProfiles.PropertyConstants]::AccountName].Value.ToString()
    $webs = $site.AllWebs
    foreach ($web in $webs)
    $permissionInfo = $web.GetUserEffectivePermissionInfo($userLogin)
    $roles = $permissionInfo.RoleAssignments
    write-host "Now checking the permissions of the user " $userLogin " " "in the site " $web.Url
    for ($i = 0; $i -lt $roles.Count; $i++)
    $bRoles = $roles[$i].RoleDefinitionBindings
    foreach ($roleDefinition in $bRoles)
    if ($roles[$i].Member.ToString().Contains('\'))
    write-host "The User " $userLogin " has direct permissions " $roleDefinition.Name
    else
    write-host "The User " $userLogin " has permissions " $roleDefinition.Name " given via " $roles[$i].Member.ToString()
    Thanks for the help.
     

  • How to find the list of plants that a user has access to

    Hi,
    Can any one help me pull all the plants that a user has authorization for?
    Is there any fucntion module that gives this list or any table from where i can pull this?
    Please let me know.
    Regards,
    Kumar.

    Looks like this FM is only giving the list of all users who has got authorization to a specific autho object say M_EINF_WRK (plant).
    But my requirement is; i will pass my user id and it should give me all the plants that i have access to.
    Please suggest.
    Regards,
    Kumar.

  • Search which report user has access to?

    I need to search the ReportServer to find which report an individual has access to?
    This will not be via the a UserGroup, but on a individual name basis.
    thanks,

    Hi ,
      Try the below query
    USE ReportServer
    Go
    DECLARE @UserName sysname
    SELECT @UserName ='<UserName>'
    SELECT C.Name
    ,U.UserName
    ,R.RoleName
    ,R.Description
    ,U.AuthType
    FROM Reportserver.dbo.Users U
    JOIN Reportserver.dbo.PolicyUserRole PUR
    ON U.UserID = PUR.UserID
    JOIN Reportserver.dbo.Policies P
    ON P.PolicyID = PUR.PolicyID
    JOIN Reportserver.dbo.Roles R
    ON R.RoleID = PUR.RoleID
    JOIN Reportserver.dbo.Catalog c
    ON C.PolicyID = P.PolicyID
    WHERE U.UserName = @UserName
    ORDER BY U.UserName
    Best Regards Sorna

  • Determining wether a User has Logged into an NTDomain

    Does anyone have any suggestions as to how I can determine, programmatically,
    wether a user has logged into an NT Domain, from a Win95 PC.
    From an NT workstation, I can simply check the USERNAME andUSERDOMAIN environment variables. Is there possibly a Win32 API
    call that I can make ?
    Thanks,
    -Carl
    Carl Schei
    Technical Forte Consultant
    South Africa
    +27 31 3641765 (w)
    email : [email protected]
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

    Does anyone have any suggestions as to how I can determine, programmatically,
    wether a user has logged into an NT Domain, from a Win95 PC.
    From an NT workstation, I can simply check the USERNAME andUSERDOMAIN environment variables. Is there possibly a Win32 API
    call that I can make ?
    Thanks,
    -Carl
    Carl Schei
    Technical Forte Consultant
    South Africa
    +27 31 3641765 (w)
    email : [email protected]
    To unsubscribe, email '[email protected]' with
    'unsubscribe forte-users' as the body of the message.
    Searchable thread archive <URL:http://pinehurst.sageit.com/listarchive/>

  • Log to check as to which user has accessed which report?

    Hi,
    I am using BOBJ for report creation and SAP BI for datawarehousing.
    The user can access these reports using the iviews created in the portal. Due to some performance testing requirements we need to check which user accessed which report and if he has drilled down to a particular level in a report, then there should be a means to know that as well.
    BO offers a few standard activity reports to check which user has done which activity. However the details of drill down etc. cannot be checked using that. Please help as to how can we check that too.
    Best Regards,
    Neha

    Hi,
    See [Business Objects|/community [original link is broken]; and [Crystal Reports|/community [original link is broken]; forums for this topic.
    -Paul

  • How to check if a user has access to a responsibility

    Hi,
    I have a user_id in the controller. How do I know if this user has a particular responsibility added to him or not. I guess there a specific proflle call which gives this information. Can you give me that information.
    Thanks,
    HC

    Create a vo with the following SQL passing userid as bind value:
    SELECT C.USER_NAME,
    B.RESPONSIBILITY_NAME,
    A.START_DATE,
    A.END_DATE
    FROM APPS.FND_USER_RESP_GROUPS_DIRECT A,
    APPS.FND_RESPONSIBILITY_TL B,
    APPS.FND_USER C
    WHERE C.USER_ID = A.USER_ID
    AND C.USER_NAME= :1
    AND B.RESPONSIBILITY_ID = A.RESPONSIBILITY_ID
    You will have the list of all the responsibilities of a user.
    Kristofer

Maybe you are looking for

  • How to configure header out put preview in Sales Order

    Hi ,            i have couple of questions..... 1,How to configure header out put preview? 2.Step by step procedure to configure handling units Points for right answer Lekha

  • Satellite L655D won't start anymore

    So I spilled ramen soup onto my cousin's laptop (so stupid...) on the body below the keyboard... She took it home to clean it some but I guess she did a poor job because it started for a few hours and then the next day, it refused to start... I kind

  • JTable issues

    I'm using JDK 6 and i would be glad to get answers to the following regarding JTable? 1) I am using setAutoCreateRowSorter(true) to enable sorting of my JTable columns. When i have a sorted column which is editable, how can i prevent the column from

  • Annoying problem when searching contacts

    Ive got an N81 and this is the first time ive had a nokia in years. My previous phones never had this problem. When searching the phonebook, lets say i press 'M' not only do the contact that start with 'M' come up but also for example a contact by th

  • What do the symbols mean

    on the top bar where it shows you what you are connected to it shows 3 icons a • A "E" and a "3G" What does each one mean