GetSubwebsForCurrentUser does not check Root site

Hi,
I am trying to check if logged-in user has permissions to site. I have used the "getSubwebsForCurrentUser", but it does not check the Parent site and only checks for subsites. What am I missing?
My current code is as below:
function sharePointReady() {
clientContext = new SP.ClientContext.get_current();
web = clientContext.get_site().get_web();
_currentUser = clientContext.get_web().get_currentUser();
webCollection = web.getSubwebsForCurrentUser(null);
clientContext.load(webCollection);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onWebsLoaded), Function.createDelegate(this, this.onQueryFailed));
function onWebsLoaded(sender, args) {
var webEnumerator = webCollection.getEnumerator();
while (webEnumerator.moveNext()) {
var web = webEnumerator.get_current();
olist = web.get_lists().getByTitle("Pages");
clientContext.load(olist);
clientContext.executeQueryAsync(onRequestListSucceeded, onRequestListFailed);
I have also tried the "web" variable as
web = clientContext.get_site().get_rootWeb();
How to fix this?
Thanks

Hi,
The SP.Web.getSubwebsForCurrentUser Method returns the collection of child sites of the current site.
http://msdn.microsoft.com/en-us/library/office/jj246242(v=office.15).aspx
If you want to check permission for current application scope, we can use
SP.Web.getUserEffectivePermissions Method to achieve it.
http://msdn.microsoft.com/en-us/library/office/jj850885(v=office.15).aspx
http://blog.fidelityfactory.com/2011/11/29/sharepoint-client-ecma-script-check-user-permissions/
More information:
http://sharepoint.stackexchange.com/questions/40082/js-jquery-check-if-on-root-web-of-root-sitecollection
Thanks,
Dennis Guo
TechNet Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected]
Dennis Guo
TechNet Community Support

Similar Messages

  • PO creation-ME21n-Why SAP does not check company code and Plant relation

    Hi All,
    Does someone know, why SAP does not check Plant and company code relation at the time of PO creation or how can we put validation between plant and company code at the time of PO creation.
    <b>Example:</b> Suppose i have a company 0001 which is assinged to Plant 0001. when i am creating a PO with another company code 0002(Entering at header level-Org, data) and using Plant 0001 at line item level. SAP does not do this validation.
    How can we put this check in place?
    Thanks in advance.
    Deepak

    Hello Deepak,
    There are three types of purchasing
    - Company code specific :You need to assign company code to Pur organization
    - Plant specific : You must assign plant to pur organization
    - Cross company purchasing: No assignment between company code and pur organization.
    In the case 3, the system will not check company code and plant relationship, but it will check plant and pur organization specific.
    The following is the copy of sap help text:
    You can assign a purchasing organization to one company code. This is company-specific purchasing.
    You can assign a purchasing organization to no company code. This purchasing organization can then procure for all plants assigned to it, irrespective of the company code to which the plant belongs.
    Since each plant must be assigned to a company code, the company code can be determined via the plant in each procurement transaction, even if the procuring purchasing organization is not assigned to a company code.
    A purchasing organization must be assigned to one or more plants. This is plant-specific purchasing.
    Now, check your company-code and purchase organization assignment.
    Hope this helps.
    Regards
    Arif Mansuri

  • Vl01n for so does not check batch management

    batch management on the mm was not initially checked.
    was checked after the material was put on the so.
    unrestricted batch stock does exist
    attempt to vl01n for that line creates a delivery but does not check batch management under material tab
    what needs done to get the delivery to inherit the batch management check?

    Dear Starz,
    I guess according to SAP standard -  The indicator cannot be changed if stocks exist in either the current period or in the previous period.
    However the same would be applicable as soon as you post the new stock after changing the material master record.
    Hope this helps...
    Give points if useful...
    Thanks,
    Jignesh Mehta

  • Record does not "check in" after workflow is complete

    Hi All,
    I have built a very simple workflow as below
    1. start step
    2. process step
    3. approve step
    4. stop step
    in the fourth step that is the stop step i have selected "check in" so that the record automatically check's in after the process is complete,
    but the record does not check in and the data manager shows it as in workflow. please help
    Thanks in Advance
    Sharma.

    Hello Abhishek,
    Thanks for the reply.
    The issue is resolved.
    The user had the authorizations and the records were checked out as well.
    i was missing the step of "Mark as approved" that was the reason for the records not to check in automatically.
    Thanky you again.
    Regards,
    Sharma

  • AVK does not check includes

    Hi, AVK does not check include jsp files <jsp:include
    any clues?

    Hi
    This is a known issue with the AVK which we will be addressing in a future release

  • I am on a MAC Application. It has  been rejected by following reason.  This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed. We recommend implementing receipt validation to reso

    I am on a MAC Application.
    It has  been rejected by following reason.
    This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed.
    We recommend implementing receipt validation to resolve this issue.
    At a minimum, the app will need to check for the existence of an App Store receipt and exit at launch with a status of 173 if it does not exist.
    Any help ?
    Thanks in Advance.

    I am on a MAC Application.
    It has  been rejected by following reason.
    This app does not check for the existence of a purchase receipt, which can prevent In-App Purchases from being correctly processed.
    We recommend implementing receipt validation to resolve this issue.
    At a minimum, the app will need to check for the existence of an App Store receipt and exit at launch with a status of 173 if it does not exist.
    Any help ?
    Thanks in Advance.

  • 262 Movement Type Issue - Does not check order

    Hello,
    A material is issued via a 261 to an order.
    Say this order is now complete and we want to do a 262 back into stock SAP does not check whether or not the material had ever been issued to the order I entered in my 261.
    Is there anyway we can have a 262 movement type check whether the material is in the order we enter?
    N.B. I am aware we can use MBST, however this doesn't help for partial reversals.
    E.G.
    MIGO - 261
    Material     123456789
    Order2       123XYZ
    Plant          1234
    MIGO- 262
    Material    123456789
    Order2      RANDOMORDER
    Plant        1234
    The above scenario will post okay.  We don't want it to as Order 2 has never had anything to do with material 123456789.
    Any help is greatly appreciated.
    James

    Shakti,
    You did not read my problem.
    As I have said using MIGO to reverse the 261 does not check if the material was issued to that order.  If I wanted to I can 262 back to an order that I've just found randomly....
    My question was how can we get SAP to check whether the order we used has issued that material before (in the 261).

  • Fifefox 5 does not display web sites properly, firefox4 does

    My website www.auraltronics.com has a javascript menu that does not display at all on my laptop W7 - 64bit, Firefox5, yet it displays properly on other browsers, such such as Chrome, and IE. Also it displays properly on my desktop running XP and Firefox4
    On my laptop I also see font display issues at other websites such as Grassroots.org

    Clear the cache and the cookies from sites that cause problems.
    "Clear the Cache":
    * Tools > Options > Advanced > Network > Offline Storage (Cache): "Clear Now"
    "Remove Cookies" from sites causing problems:
    * Tools > Options > Privacy > Cookies: "Show Cookies"
    Start Firefox in <u>[[Safe Mode]]</u> to check if one of the extensions is causing the problem (switch to the DEFAULT theme: Firefox (Tools) > Add-ons > Appearance/Themes).
    *Don't make any changes on the Safe mode start window.
    *https://support.mozilla.com/kb/Safe+Mode
    *https://support.mozilla.com/kb/Troubleshooting+extensions+and+themes
    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    *http://kb.mozillazine.org/Zoom_text_of_web_pages
    If you have increased the minimum font size then try the default setting "none" as a high value can cause issues like you described.
    * Tools > Options > Content : Fonts & Colors > Advanced > Minimum Font Size (none)
    *Tools > Options > Content : Fonts & Colors > Advanced > [X] "Allow pages to choose their own fonts, instead of my selections above"

  • Firefox shows an unknown certificate error while Chrome does not for same site

    On a site at which Credit Card payment info is shown, Firefox is reporting a certificate error while Chrome does not. Prefer to use FF but need to know if warning is right or not. Have cleared the cache and still get the warning. This is new to FF as we've used it on this site for several years.

    HI khetheri,
    In order to better test the certificate may we request the certificate without the private keys? I have some backup from the security team if this is possible.
    There is a temporary work around as well but I don't recommend turning on all certificates to make sure it is not a compatibility error(ish)
    It is possible to check if it is being detected as a bad certificate in Firefox itself to eliminate compatibility issues.
    # In the [[Location bar autocomplete|Location bar]], type '''about:config''' and press '''Enter'''. The about:config "''This might void your warranty!''" warning page may appear.
    # Click '''I'll be careful, I promise!''', to continue to the about:config page.
    # Search for '''browser.xul.error_pages.expert_bad_cert ''' and set it to true to try the certificate normally.
    Looking forward to your reply!

  • List 'Workflow History' does not exist at site with URL

    Hi techies,
    I got this error while activating a feature, where I attach the workflows to the lists which exists within sites.
    And i have also deployed all the workflows which are to be used.
    Anybody faced this similar error?

    Are you trying to get workflow history list in your code? (custom feature or VS workflow) if so then can you verify your code and make sure that your are searching for this list at root level. (workflow history list is common list and available at root site
    collection only)
    http://servername/Lists/Workflow%20History/AllItems.aspx
    To get list via code see below blog:
    http://sharepointdevelopertopics.blogspot.in/2011/07/how-to-get-workflow-history.html
    http://weblogs.asp.net/jevgeni/archive/2011/05/05/getting-default-workflow-history-list-in-sharepoint.aspx
    Correct me if i am wrong
    Hemendra: "Yesterday is just a memory,Tomorrow we may never see"
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer
    Please feel free to unmark answer if does not resolves your problem.

  • Flash Player does not work on site funnygames.nl

    Since I installed Flash Player 11.1.102.55 all sites and users on my computer seems to be working correctly with Flash Player. Only the site funnygames.nl does not see the ActiveX installation of Flash. Each time when a game is to be loaded in Internet Explorer IE asks for installation of the ActiveX component.
    Only when starting IE as administrator user the games do work.
    OS: Windows 7 (64bit)
    IE: Internet Explorer 9

    Hi Jan,
    I tried this out with both the latest version of FP and the previous version and I was also able to reproduce this issue.  I suspect that funnygames has something incorrectly configured on their site.  Have you tried contacting them to see what they had to say?
    Chris

  • ERS does not check duplicate invoice check

    Hi there,
    We have all the vendors in the vendor master set up with duplicate invoice check on. However this does not work during MRRL process.
    Any sugegstions, information is greatly appreciated.
    Thanks,
    Gajanan

    Hello Gajanan,
    If you create an invoice with transaction MRRL (ERS) then this invoice
    will be created automatically in the background (not online).
    Unfortunately I have to inform you that the function 'Duplicate
    invoice check' is not implemented for ERS. This check was primarily
    written for the online transactions, like MIRO.
    A possible solution to this issue is contained in  note
    48121 which describes how you can create your own validation user exits
    in the FI interface (function module ckmv_ac_document_create). In such
    an user exit you can implement your own coding, for example the double
    check for the invoices:
    the following
      CALL FUNCTION 'MRM_FI_DOCUMENT_CHECK'
        EXPORTING
          i_bukrs                = i_bukrs
          i_lifnr                = i_lifnr
          i_waers                = i_waers
          i_xblnr                = i_xblnr
          i_bldat                = i_bldat
          i_wrbtr                = i_rmwwr
          i_blart                = i_blart
        EXCEPTIONS
          invoice_already_exists = 1
          OTHERS                 = 2.
    will be called in the validation user exit and if the sy-subrc = 1
    (invoice already exists) then your own error message will be proceeded
    and the invoice won't be posted.
    Hope this helps
    Ray

  • Why does search option in history doesn't work? It does not display any sites I've been to.

    I enter history, type a name of a site I've been to in 'search' or 'find' field (I'm using polish version so I don't know the exact name of that field) and it does not find anything. I haven't cleared my history, it's all there when I open 'today', 'yesterday' etc. tabs. Only finding it using search option doesn't work.
    It used to work fine now it doesn't. I haven't installed anything.

    Make sure that you're not running Firefox in Private Browsing mode.
    https://support.mozilla.com/kb/Private+Browsing
    You enter Private Browsing mode if you select:
    Tools > Options > Privacy > History: Firefox will: "Never Remember History"
    To see all History and Cookie settings, choose:
    Tools > Options > Privacy
    choose the setting Firefox will: Use custom settings for history. Deselect:
    [ ] "Permanent Private Browsing mode"

  • Ended Alveza card status I have been asked by Apple to update the card, but whenever you want to update the collateral does not accept Visa site update Why

    Visa expired my right was my claim by Apple update the credit card, but whenever you want to update the Visa my right in the site does not accept site update Why

    if i have to read any comment by matt n again i will throw up...in my mouth. i have gone all over google trying to figure out what the f ff did to me without my permission, i have updates turned off so there should be no prompting to restart, there should be a polite offer not a forced update. i am angry and so are a ton of people.
    everytime i go to a new complaint, another angry fellow ff user there is matt n with his infuriating smiling little picture...telling me about the awesome safety and security of the new ff...ignoring that a supposed safe but ugly and unusable browser is worse than a customized, beautiful, well functioning browser...with supposed safety issues. i am so angry i cannot express how this has wasted my time. i have been online for 2 hours now figuring out how to fix, apparently i cannot. my old theme is not compatible now...so i am screwed.
    good bye. if i wanted chrome i would have had chrome. but i have no choice now.

  • Lingoes translation does not connect to site after install Firefox 4 & after restore to 3.6.16, why?

    Running Windows Vista Home Premium on a dual processor with 4 GB of RAM and a HD with 50% empty. Yesterday downloaded Firefox 4 only to find that Lingoes translation software that must connect to the web site for the translations could not; as some other privacy software (GoogleShare & Tor) could no longer be used decided to restore to Firefox 3.6.13, subsequently updated to 3.6.16. While GoogleShare & Tor now function, Lingoes still does not.

    Simply download the latest version, Lingoes 2.8, which provides a firefox plug-in to support the feature of text capture.

Maybe you are looking for