Show link based on user permission

hello ,
i have a user control that display a simple link to a list and i would like to show link only for users who have access to the list.
if the user has not access to list , he should no see the link.
How to reach my goal ? 
Thanks

You can use JavaScript client object model code to check the permissions of the user on the list. Specifically, you will need to check for viewListItems permissions. Here is a smple code to get permissions of the user on the list.
Note that this code will retrieve the current user's permissions. 
var list
function getUserPermissions() {
var clientContext = SP.ClientContext.get_current();
list = clientContext.get_web().get_lists().getByTitle('L5'); clientContext.load(list, 'EffectiveBasePermissions'); clientContext.executeQueryAsync(onQuerySucceeded, onQueryFailed);}
function onQuerySucceeded() {
if(list.get_effectiveBasePermissions().has(SP.PermissionKind.viewListItems)) {
//Show link
else {
//Don't show link
function onQueryFailed(sender, args) {   
alert('Request failed. ' + args.get_message() +  '\n' + args.get_stackTrace());
SP.SOD.executeFunc('sp.js', 'SP.ClientContext',getUserPermissions);
However, if you are comfortable with Server side object model code, you can use:
var currentUser = SPContext.Current.Web.User;
SPList.DoesUserHavePermissions(currentUser, SPBasePermissions.ViewListItems);
See this for more information: http://www.mindfiresolutions.com/Checking-current-users-permission-on-a-SharePoint-list-using-C-1642.php
Nadeem Yousuf

Similar Messages

  • Navigation link based on user

    Hi All,
    I would like to give the navigation to column based on users login in a dashboard report. Suppose I have 5 users. 2 Should have navigation and 3 shouldn't have navigation when they login.
    Could anybody suggest on this how to achieve? I'm using obiee 11.1.1.6.

    Open Column properties -> 'Interaction' tab.
    Add new action link to one of two interactions (for column heading or value)
    and choose in radio-button 'Show link' value 'Conditionally' - you can add any dummy condition... it's no matter.
    After all - select 'Advanced' tab of your answer.
    Look at Analysis XML and search tags of dummy condition. Replace it with something like this:
    <saw:condition>                                   
                               <sawx:expr xsi:type="sawx:list" op="in">                                         
                                  <sawx:expr xsi:type="sawx:sqlExpression">'@{session.currentUser}'</sawx:expr>                                         
                                  <sawx:expr xsi:type="xsd:string">weblogic</sawx:expr>                                         
                                  <sawx:expr xsi:type="xsd:string">demo</sawx:expr></sawx:expr></saw:condition> Press button 'Aplly XML'
    This is example of conditions for enabling navigate link only for 'weblogic' and 'demo' users. You can extend it.

  • Customize portal "Help" link based on user roles

    Is there a chance to customize the Help link URL in Masthead iView based on user roles? The use case we have is that the "Help" should be different for users of the purchasing company from those of the supplying company.
    Thanks.

    Hello Jay.
    This is a multi step process.
    Step 1 : Create 2 desktops with everything as same but different mastheads.
    - Copy your existing desktop and paste it in your working folder in PCD (Not select Delta link)
    - Now download masthead par file.
    - Modify your masthead par file where you will disable help link. Rename you masthead file (newMasthead.par) and export it from NWDS. Now import it in portal.
    - open your framework page in desktop2. Just add your new masthead in it. Enable the new one and disable the existing one.
    Step 2 : Create 2 groups of users. (First one belong to users who wish to see help link . i.e existing desktop) (Second of thoese users who do not have to see help link i.e. newDesktop)
    - Assign users to appropriate groups.
    - Assign same roles to both groups.
    Step 3 : Modify main rule section in PCD.
    - If group = HelpLinkUsers Then Desktop1
    If group = NoHelpLinkUsers Then Desktop2.
    You may find above process bit tedious and lengthy.
    But if you wish to further customize your portal then this will be needed one day.
    If you find problems in implementing any step then please search in google or SDN.
    Please revert back on any specific question on above approach you may face while implementing.
    Thanks

  • How to hide and show Omniportlet based on user privileges

    hi all
    I am trying to hide or show an Omniportlet based on user privileges, which means accessc control on portlet-level for Omniportlet. But I couldnt find out how to do it.
    According to Portal Developer's Guide:
    You can hide and show portlets built with Web Clipping and OmniPortlet on portal pages dynamically by using security managers. Although Web Clipping and OmniPortlet do not expose security managers through the user interface, you can apply them by editing their XML provider definition file.
    Question is: where can I find that XML file? Is this file accessible and configurable somewhere through Portal Enterprise Mgr?

    Hi,
    I don't think you can edit this file through Enterprise Manager. Atleast as far as I know. But its available on the server. I have a NT installation and I found it under:
    D:\oracle\Mid_tier\j2ee\OC4J_Portal\applications\portalTools\omniPortlet\WEB-INF\providers\omniPortlet
    You might want to restart the Portal application through OEM after you change this file.
    Hope this helps,

  • How to show pages based on user logged in adf security ?

    Hi All,
    JDev ver : 11.1.1.4.0
    I have three Roles MANAGERS, ADMIN, ANALYST with users in each role.
    And i used form based authentication. There are seperate screens for each user, i want to show according to the user entered with Roles.
    How to Configure these roles in Resource Grants and what should be done in login action..
    For me the page now going forward, it remains in the login page itself
    How to do that ?
    thanks,
    Gopinath

    Hi..
    try out following sample
    http://andrejusb.blogspot.com/2011/05/oracle-webcenter-11g-ps3-adf-security.htmlalso check this >http://andrejusb.blogspot.com/2009/01/practical-adf-security-deployment-on.html

  • Shows link only if user is logged in

    Hi there,
    DW 8, PHP & my SQL
    I have a db of registered users and have links to download
    documents.
    Some of these documents are for everyone and some I only want
    to be
    downloadable or logged in registered users - all on the same
    page.
    If someone can please point me to a tutorial or advice as to
    what I am
    to do, I will really appreciate it.
    Regards,
    Deon

    back from lunch - where you at on the table?
    "crash" <[email protected]> wrote in message
    news:[email protected]...
    > Is this site for your or for a client? If a client, I
    woudl build an
    > access table that allows them to determine (or you to
    easily administrate)
    > access levels.
    >
    > If it's for you, that's not really necessary, though I
    find it helps me.
    > Somewhere write down your access levels:
    >
    > 1 - Default, open
    > 2 - Member
    > 3 - Edit (add/edit content)
    > 4 - Admin (add/edit/delete site sectiosn)
    >
    > Next, create your table for your documents. WHat
    information do you need
    > to have contained within them? How are you puloading
    them? Do they need
    > approval before being released? Do they need to expire?
    >
    > So far, we know we need this information in our
    documents table:
    >
    > docID
    > docName
    > docUrl
    > docClearance (what number of clearance is needed tob e
    read)
    >
    > We may need these fields:
    > docDateAdd
    > docDateEdit
    > docDateRemove
    > docPublish (can be bool, or 1 - 4 to define steps of
    publication such as
    > submission, waiting, approved, live)
    >
    > Do you grab your users' clearnace on your login page?
    (it's a checkbox on
    > hte MM server behavior thingy)
    >
    > More after lunch, get those tables setup.
    >
    > "Deon" <[email protected]> wrote in
    message
    > news:[email protected]...
    >> crash, my db is set up and users can log in and out.
    Just for what it
    >> might be worth in the future, I have a default
    Access level of 1. That's
    >> where I am now.
    >>
    >> Deon
    >>
    >>
    >> crash wrote:
    >>> Where are you at now? Do you ahve your database
    setup at all? Or are
    >>> you saying you have your database setup, but
    only a table for the users
    >>> in it?
    >>>
    >>> Should not need a tutorial, should be fairly
    straight forward.
    >>>
    >>>
    >>> "Deon" <[email protected]> wrote
    in message
    >>> news:[email protected]...
    >>>
    >>>>Crash,
    >>>>
    >>>>thanx for the time to answer my question. My
    db only makes provision for
    >>>>the registered users. At the moment I only
    know what I want and have no
    >>>>idea how to get there. Are there tutorials
    you are aware of for this? If
    >>>>not, I can Google if I know what to look for.
    >>>>
    >>>>Thank you again!
    >>>>Deon
    >>>>
    >>>>
    >>>>crash wrote:
    >>>>
    >>>>>What separates the two out in your
    database? Do you have a "class"
    >>>>>field to determine document class (ie,
    private or public?) Do you have
    >>>>>a table of association that says which
    users or which level of users
    >>>>>can access which documents?
    >>>>>
    >>>>>Getting that built will be your first
    step. After that, I would build
    >>>>>two recordsets, one public and one
    private. I would then use DW's show
    >>>>>region if recordset is not empty Server
    Behavior to show the links I
    >>>>>wanted.
    >>>>>
    >>>>>Another way to buidl ti would be to use
    one recordset and the split the
    >>>>>two (public/private) into arrays and
    display them according to isset()
    >>>>>statements.
    >>>>>
    >>>>>HTH,
    >>>>>
    >>>>>Jon
    >>>>>"Deon" <[email protected]>
    wrote in message
    >>>>>news:[email protected]...
    >>>>>
    >>>>>
    >>>>>>Hi there,
    >>>>>>
    >>>>>>DW 8, PHP & my SQL
    >>>>>>
    >>>>>>I have a db of registered users and
    have links to download documents.
    >>>>>>Some of these documents are for
    everyone and some I only want to be
    >>>>>>downloadable or logged in registered
    users - all on the same page.
    >>>>>>
    >>>>>>If someone can please point me to a
    tutorial or advice as to what I am
    >>>>>>to do, I will really appreciate it.
    >>>>>>
    >>>>>>Regards,
    >>>>>>Deon
    >>>>>
    >>>>>
    >>>
    >
    >

  • Don't display team in a team project based on user permission

    Hi all,
    I have a problem because I want to disable display and access to a Team Project\Team in WebAccess.
    My organization for a team project in my collection:
    Team project Customer
    --> Customer dev team (default team)
    --> Customer consulting team 
    --> Customer Support team
    Each team have an area.
    "Support team" doesn't have access to see and edit WorkItems in "Customer dev" and "Customer Consulting" areas, it's ok but I want that Support team member never have access to the "Customer dev team" and "Customer
    consulting team"
    I log in as a Support team member, Security works well for workitems but when i go to "Browse all", the popup "Browse Server" display all teams under team project name. It's a problem for me.
    Do you already see this security problem ?
    Is this possible to do this in TFS 2013 (Update 4) ?
    Thanks.

    Thanks for your reply.
    I do this test with two users : Me and ISupport (ISupport is a local account on TFS Server because I don't have permission to add user to AD for my test)
    Team Project Customer teams :
    --> Support Team users:
     - ISupport
    --> Customer dev team :
     - Me
    --> Consulting dev team
     - Me
    ISupport in only include in Team Project Customer\Support Team
    If I log in as ISupport user, I see all teams in Team Project Customer List in Browse Server popup.
    I always have an access to Customer dev team and Customer consulting team home page.
    (I can't create a bug because workitem security is set on Area permission)
    If I just remove ISupport user from Team Project Customer\Support Team, I can't see the Team project Customer in Browse server pop up, it's ok.
    How I can set permission to only limit ISuppport user to access Support team ?

  • Is it possible to change submit button's URL link based on user input?

    I have a separate html page that does this with a php script, but I had help creating that php file which is just a form that allows users to enter a passcode that I provide them which will then simply link them to an external html page.  Since I don't know about php, I am thinking a possible work around would be to have a text input box which would allow a user to enter (passwordA) then click Submit to load (pageX.hmtl) or they could enter (passwordB) and Submit would load (pageY.html).  
    If anyone knows how I could link my new flash project with my .php file, that would be great, or if there is AS3 code that would do this I would love that!

    I have the php file on my server and the correct path in my as3 now.  Here are the exact codings I'm using:
    AS3:
    stop();
    import flash.events.*;
    import flash.net.URLLoader;
    import flash.net.URLLoaderDataFormat;
    import flash.net.URLRequest;
    submit_btn.addEventListener(MouseEvent.CLICK, btnDown);
    function btnDown(event:MouseEvent):void {
    var variables:URLVariables = new URLVariables();
    var varSend:URLRequest = new URLRequest("http://www.jmusicphoto.com/flashClient.php");
    var varLoader:URLLoader = new URLLoader;
    varSend.method = URLRequestMethod.POST;
    varSend.data = variables;
    passcode_txt.text = "";
    submit_btn.addEventListener(MouseEvent.CLICK, passcodeSend);
    function passcodeSend(event:MouseEvent):void{
    variables.key = passcode_txt;
    varLoader.load(varSend);
    flashClient.php:
    <?php
    if($_REQUEST['key']) {
    $key = $_REQUEST['key'];
    $key = strtolower($key);
    switch($key) {
    case 'home':
    header('Location: http://www.jmusicphoto.com/index.php');
    break;
    default:
    echo "Oh noes!  You got something wrong.  You typed " . $key . " maybe there is a mistake?<br><br>";
    break;
    ?>
    Practically same php code is working here: http://www.jmusicphoto.com/EOSlogin.php   "home" 

  • Can I use action link based on hierarchical column?

    Hi all,
    I used OBIEE 11.1.1.6.2.
    And I want to know can I use action link based on hierarchical column? I want to show link based on some conditionally..
    I try to add conditions, such as Department is equal to A, But after I added, it show me "Department is equal to", why?
    Can anybody give me some hints?
    Regards,
    Anne

    Hi Anne,
    It should work. How did you add the action link? .Click on the + icon on the hierarchical column in criteria tab, this will list all the columns in the hierarchy.Each column will have its own column properties. Click on the Hierarchy level properties of Department column ->Interaction tab and define your conditional action link.
    Regards,
    Dpka

  • Show / Hide DOWMLOAD link in classical report based on user rights

    Hi,
    using apex 4.1.
    How i can display or hide download link in classical report based on user rights .
    The User who has download rights ,can download the data from classical report Otherwise it should hide.
    I have passed the code in authorization scheme in shared component as named "VIEW"
    DECLARE
    VNAME VARCHAR2(1000);
    BEGIN
    SELECT PAGE_NAME INTO VNAME FROM APEX_APPLICATION_PAGES WHERE PAGE_ID = :APP_PAGE_ID AND APPLICATION_ID = :APP_ID;
    return GET_ADMIN_STATUS_VIEW_NEW(:APP_USER,VNAME);
    END;How i can call "VIEW'' name in download link.

    Right click on the export link, select copy url. Create a button with redirect to URL. Use that URL (or at least everything with and after f?p). Bind rights to the button.
    Or create a second identical report with different rights, give one export enabled and one disabled. The first is better, the second is easier :)
    Edited by: Joni Vandenberghe on 8-feb-2013 5:08

  • Showing/Hiding Dashboard Prompts dynamically based on User logged on

    Hi
    I have query reg a showing/hiding dashboard prompts based on Users logged in.
    What is the best way???
    Please help
    And also anothe quick question
    Is there a way that we can change the Label of Dashboard prompt "ABC" for few users and "DEF" for other users
    Thanks in advance
    Cheers

    Hello,
    Using guided navigation properties for section, we can achieve your first requirement.
    How many prompts to be shown?
    depends on that number, you have to create those many reports in answers like,
    take one column to criteria and change functionaityt to case when 1=0 then Markets. Region else user() end
    apply filter on this equals to UserA (for userA), say ReportA
    for UserB filter has to change to UserB, say ReportB...etc
    Now, add all the prompts to dashboard, but each section (dashboard object) for each prompt.
    Go to section properties of each and select guided navigation property. The section which is holding the PromptA (should be shown to userA) then browse the reportA for guided navigation and click ok
    LIke this do for all prompts.
    Hope you understood...
    if any queries ask me..
    And for 2nd Q, in prompt, you have Select captio option which is the last option for all prompts,
    Write something there and check

  • Search Query that shows articles based on the current logged in users Office location

    Hi,
    I've set up a "news" channel that shows articles targeted to the current user. Basicly this on done by queryting the property of the custom "Office Location" termset.
    My setup is something like the following in my term store:
    The setup works perfect now. countries are not taggable so at the moment the user needs to choose City 1.. City 2 etc. for their articles which works fine since sometimes articles are also only targeted to cities and not countries.
    Anyways now we have got 2 users in City 4. Here it makes no sense that articles should be targeted City 3 and City 4 in order to show articles to entire Country 2. Basicle what I want here is that if an article is targeted with City 3 it should also be shown
    to City 4 users.
    How is this archived best? I have tried to make the Countries available for tagging as well, however it not show anything since the user property of course still is City 3 or City 4.
    Thanks for your time

    Hi,
    You can not get hold of the parent in your scenario. You want the parent of the tagged term in the user profile, and there is no built-in mechanism in search to get this. So as I mentioned you have to use JSOM to get the parent term, and then use that in
    your owstaxIdOfficex0020Location:term query.
    owstaxIdOfficex0020Location:{User.SPS-Location.IDWithChildren}
    would be a valid query, except it won't help you much :)
    Thanks,
    Mikael Svenson - Search Enthusiast
    SharePoint MVP/MCT/MCPD - If you find an answer useful, please up-vote it.
    http://techmikael.blogspot.com/
    Author of Working with FAST Search Server 2010 for SharePoint

  • End user permission ignored

    Hello,
    I have a problem with an end user permission that seems to get ignored: I wanted to demonstrate the usage of the end user permission and assigned a role to a User (for simplicity's sake as an entry point, no worksets, pages etc. involved) and enabled end user permission on the role for that particular user.
    Now when that user logs in he gets to see the according entry in the navigation bar as expected. However if I disable the end user permission, log out and again log in the user, he stills sees the link. The end user permission setting is simply ignored. Can someone shed light onto this, could there be something wrong with the installation)?
    I don't think this is an issue of permission inheritance (the role permissions are set explicitly anyway) or overlapping permissions due to membership in several groups - the user is only member of the single standard  group 'authenticated users'.
    Regards,
    Sebastian
    P.S. What's the use of a role assignment to a user without end user permission anyway (I mean why the option)? What happens if you don't add permissions on a Role for a certain user at all (I tried it, but the effect is the same as described above - end user permission seem to be irrelevant)?

    Hi Robert,
    thanks for your answer and for the link (and I thought I had read everything). I am not so sure however if I really understand the term 'runtime environment' for a user. I thought runtime vs. design-time meant the difference between the content a user sees when he is actually using the portal and the content an administrator has access to in the portal content catalog, i.e. a meta-environment accessible only through certain tools like the permission editor or similar.
    I don't understand what you want to express with "<i>It's used to restrict ... end user runtime environment</i>" and why the "Page Personalization" is an example.
    I realize that for roles the availability for a user is solely defined by the assignment of that role to the user - end user permissions have no effect on this. Confusing, because I tought this availability (i.e. showing links in the toplevel or detailed navigation) was what was meant by 'runtime environment' but I seem to be wrong here.
    The docu says "<i>for roles the end user permission setting does enable you to define which users/groups/roles are able to preview the role content using the portal design-time tools</i>". Again, I am confused, I thought this was exactly the meaning of design-time environment.
    Great if you or someone else could comment on this..
    Regards,
    Sebastian

  • Build a blank/other type of page which can show links to other pages

    Can someone please tell me how to build a blank/other type of page which can show links to other pages? I mainly want a page to show 3 links, once someone clicks on it, then it will go to a specified page. I tried using URL, but that did not work. Any advice is greatly appreciated. Thank you very much for your help in advance.
    -Grace

    Do a region (probably a HTML-based one is fine), enter in the HTML for your links, and that should be it. What didn't work about this?
    Your links probably should appear like this in your coding (use substitution variables):
    f?p=&APP_ID.:3:&APP_SESSION.
    In the above example, "&APP_ID." will resolve dynamically to the application ID that you are in, "3" is page 3 (change this to whatever page you want the link to be), and "&APP_SESSION." is the existing session number (if you don't include this, the user will receive a new session ID if the destination page is public or will be intercepted annoyingly to log in and get a new session ID which you probably don't want).
    Do not include the full http path. Just start with f?p... and everything is assumed to be relative to Apex on the current environment.
    Those are effectively the minimum requirements for a URL in Apex to go from one page to another in an app. You can add to that the additional URL parameters for Request value, Set items with values, clear cache, reset pagination, etc. if you need to. Check the Apex online help under "understanding URL syntax" for details on these.

  • BI Bex Query prompt based on User's Authorization....

    Hi
    In BI, I created 1 BEx Query based on Authorization. If a user runs the query, it prompts for 'Customer Name' to get data of particular customer. And Customer values are populated in the prompt based on User's Authorization.
    For example:
    User1 is authorized to see data of Customer1 & Customer2. So, Query prompt will show 2 values: 'Customer1' & 'Customer2'.
    But User2 is authorized to see data of Customer1, so Query prompt will show 'Customer1' only.
    I created 2 variables on Customer field:
    1) Authorization Variable in Filter Section
    2) Manual, Single Entry, Mandatory on Default Value section.
    My Requirement:
    If user is authorized to link with only 1 Customer, he should not get prompt & on the background prompt value should be populated from his authorization value. But if user is authorized to see multi-customers, then prompt should appear.
    If possible pls. provide some suggestions....
    Thanks...

    Yes, this can be done.
    but there is little work around.. Using guided navigations
    1. Create a report with column fx as case when 1=0 then markets.region else user() end
    2. apply filter on this column is equal to User_1
    3. Create another report with column fx as case when 1=0 then markets.region else user() end
    4. apply filter on this column is equal to User_2
    5. Now add all your prompts to dashboard, but each prompt should in each section object of dashboard.
    6. For first section click on section properties, go to Guided Navigation...
    7. Browse Source Request as first report.. and keep If request returns rows selected.
    8. Repeat above step for another section.. but this time browse 2nd report.
    9. Just save dashboard.
    Check now..
    Hope you understood..
    Regards
    Kishore Guggilla
    Edited by: Kishore Guggilla on Feb 18, 2009 12:57 PM

Maybe you are looking for