locked
Manager permissions RRS feed

  • Question

  • Hi

    I read this blog of Beth Massi.

    I implement this manner for manager permission in my project.
    So, in my local machine work succesfull, but in the Server machine doesn't work.
    Why?
    I think which miss  some component in 'Microsoft Web Platform', this is correct?

    Thanks, best regards.


    • Edited by Arenaut Monday, August 5, 2013 11:48 AM
    Monday, August 5, 2013 11:24 AM

Answers

  • Hi,

    I finded the answer in this blog.

    The article is great! The side which most interesting is following:

       Deployment Note: If you want to publish your app to an IIS server, note that you’ll need one extra component. Using    the NuGet Package manager on your Server project, add the NuGet package “Microsoft.Web.Infrastructure”. This    is installed already on some IIS machines, but not all of them.

    Thank you anyway.

    I hope is help somebody.

    Regards.

    Ale

    • Marked as answer by Yunjie Pei - MSFT Thursday, August 8, 2013 1:05 AM
    • Unmarked as answer by Arenaut Thursday, August 8, 2013 4:27 AM
    • Marked as answer by Arenaut Thursday, August 8, 2013 4:27 AM
    Wednesday, August 7, 2013 7:56 AM

All replies

  • Hi,

    >>but in the Server machine doesn't work

    Do you mean encountering problems when deploying applications that use Forms Authentication?  LightSwitch application has different types and we can deploy the client as a Desktop application or a Web (browser-based) application. A Desktop application runs outside the browser on a Windows machine and has access to the computer storage and other running applications.

    Beth Massi has another blog regarding configuring a web server to host LightSwitch applications, and it is suggested to read.

    Hope it can help you.


    Yunjie Pei
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Tuesday, August 6, 2013 9:22 AM
  • Hi,

    I have this error on the server machine: 


    Could not load file or assembly 'Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. 

    From VS2012 my application runs perfectly. 

    I have this script inside Global.asax:

       protected void Application_Start(object sender, EventArgs e)
            {
                RouteTable.Routes.MapHttpRoute("PermsApi", "Perms/{controller}");
            }

    And in my controller class I have these lines of code:

     public class UserPermissionsController : ApiController
        {
         public Dictionary<string, Boolean> Get()
            {
                Dictionary<string, Boolean> perms = new Dictionary<string, Boolean>();

                using (ServerApplicationContext ctx = ServerApplicationContext.CreateContext())
                {
                    var currentUser = ctx.Application.User;
                    if (currentUser.IsAuthenticated)
                    {
                        perms.Add(Permissions.SecurityAdministration,
                            currentUser.HasPermission(Permissions.SecurityAdministration));

                        currentUser.AddPermissions(Permissions.SecurityAdministration);

                        foreach (Permission perm in ctx.DataWorkspace.SecurityData.Permissions)
                        {
                            if (perm.Id != Permissions.SecurityAdministration)
                            {
                                perms.Add(perm.Id, currentUser.HasPermission(perm.Id));
                            }
                        }
                    }
                }
                return perms;
            }
     }

    If I remove these two part of code, my application runs correctly on the server machine.
    Why this? Is very important for me.

    Thanks, best regards.
    Tuesday, August 6, 2013 2:51 PM
  • Hi,

    I finded the answer in this blog.

    The article is great! The side which most interesting is following:

       Deployment Note: If you want to publish your app to an IIS server, note that you’ll need one extra component. Using    the NuGet Package manager on your Server project, add the NuGet package “Microsoft.Web.Infrastructure”. This    is installed already on some IIS machines, but not all of them.

    Thank you anyway.

    I hope is help somebody.

    Regards.

    Ale

    • Marked as answer by Yunjie Pei - MSFT Thursday, August 8, 2013 1:05 AM
    • Unmarked as answer by Arenaut Thursday, August 8, 2013 4:27 AM
    • Marked as answer by Arenaut Thursday, August 8, 2013 4:27 AM
    Wednesday, August 7, 2013 7:56 AM