locked
Manage Sharepoint Lightswitch Html Client (or Cloud Business App) app users RRS feed

  • Question

  • Hi everyone,

    I found many tutorials regarding how to check if the user has some permission in the app and I know how to use all of that. All of this works for me while I use Granted for debug checkboxes from project properties..
    result = this.Application.User.HasPermission(Permissions.MyPermission); 

    My problem is that I don't know how to manage the real users while the App is in release.. The publish wizard never asks for administrator.. In Sharepoint site I cannot find the MyPermission group nor the Permission Level..

    Is there someone who can tell how to manage users, set them desired permissions for lightswitch app defined in the project properties?? (I know that lightswitch html client without sharepoint has possibility to add client project for this purpose.. but this option is not available since it uses Sharepoint and I assume that users are managed through sharepoint..)

    Thursday, May 22, 2014 1:29 PM

Answers

All replies

  • LS observes SharePoint permissions of course, but has no built-in way to manage SP permissions.  You would edit permissions in the SP interface.  You can, however, use js code in your LS APP to check permissions at runtime. 

    For example, you can get permsission for a list using SP.List.effectiveBasePermissions Property:

    http://msdn.microsoft.com/en-us/library/ee552795(v=office.14).aspx

    I havn't seen any LS specific examples of this, but Bingle for sharepoint javascript permissions and you'll get lots of examples like this one:

    http://www.sbrickey.com/Tech/Blog/Post/ECMAScript_EffectiveBasePermissions_for_ListItems

    Ps...One suggestion if you want to do a lot of SP JSOM stuff is to check out SPServices Library.  Here is an example of hiding a form field based on SP group membership:

    http://www.sharepointdiary.com/2013/07/hide-sharepoint-list-columns-based-on-user-permissions.html

    HTH,

    Josh


    • Edited by joshbooker Thursday, May 22, 2014 1:57 PM PS
    Thursday, May 22, 2014 1:50 PM
  • Hi, thanks for reply..

    Huh, I have maybe missed to mention some important things.. I don't read any data from SharePoint except users as it's easier and provides better user experience if they use the app through sharepoint..

    Data-source is actually sql database and I can't really define permissions for it in Sharepoint. I just want to set the Lightswitch app permissions to Sharepoint Users or bind Sharepoint Permission Levels to Lightswitch Permissions.. (I don't know how to do that).. and later in the app I could use those lightswitch permissions for whatever I want as that works fine for me in debugging like I mentioned already because I can choose which permissions I want to grant when I debug...


    Thursday, May 22, 2014 2:06 PM
    • Marked as answer by Angie Xu Thursday, May 29, 2014 3:20 AM
    Thursday, May 22, 2014 3:17 PM
  • Ouch,

    If so.. is there a possibility to remove sharepoint from lightswitch sp solution?? (I know I can delete the project but what else should I remove from solution to turn it back to LS only)

    Thursday, May 22, 2014 5:23 PM
  • Early SharePoint enabled projects had a disable button...not so anymore. Definitely not for CBA.  There's prolly a way to edit some files.  Maybe the team or someone who's done this will chime in.  Dave Baker perhaps.

    My hope is they're taking their time to get SP auth to work right - tightly coupled with Office365 API, Azure AD, etc.  But I cannot say since we haven't had any statement of direction in a while.

    Who knows maybe they'll announce it's release today(?)  The way this week is going it could happen...Dynamic Conn Strings, Updateable Views, javascript API ...I'm sore from falling off my chair.

     
    Thursday, May 22, 2014 5:33 PM
  • Ouch,

    If so.. is there a possibility to remove sharepoint from lightswitch sp solution?? (I know I can delete the project but what else should I remove from solution to turn it back to LS only)


    There will be a backup of the project placed in a folder at: ..\Backup under the projects main folder in case you need to revert back.

    Unleash the Power - Get the LightSwitch HTML Client book

    http://LightSwitchHelpWebsite.com

    • Marked as answer by Angie Xu Thursday, May 29, 2014 3:20 AM
    Friday, May 23, 2014 11:59 AM