locked
Edit Permissions RRS feed

  • Question

  • Hi,

    is it possible to edit the source of the permissions in an editor, because i have to change very much in the permissions.
    I assume it is not recommended to edit the files "permissions.vb".

    The permissions-table in the project properties is very bad to make large edits.

    I have 45 entities each with 4 permissions (c,r,u,d)

    regards

    Oliver

    Monday, September 16, 2013 3:44 PM

Answers

  • I would say that I don't disagree (but I'm not sure I entirely agree) with you and the situation you have, but only described why it's still easier to use the existing designer compared to trying to determine what assortment of files need to be updated and, more than likely, messing up your project.

    You should submit a suggestion on the Visual Studio UserVoice site for the LightSwitch category to address this.


    Justin Anderson, LightSwitch Development Team

    • Marked as answer by OlimilO Wednesday, September 18, 2013 9:59 AM
    Tuesday, September 17, 2013 10:31 AM
    Moderator
  • You don't want to change Permissions.vb because that is a generated file. Any changes you make there will be tossed away during the next regeneration of the file (such as a clean build).

    I would recommend using the editor in the project properties to change the permission names. It will use refactoring to update your code and update all other files where permission information is stored. I think you'll find it much harder to try to figure out which files you need to update instead of using the designer.


    Justin Anderson, LightSwitch Development Team

    • Proposed as answer by Paul Van Bladel Tuesday, September 17, 2013 7:17 AM
    • Marked as answer by Angie Xu Thursday, October 10, 2013 8:18 AM
    Tuesday, September 17, 2013 3:15 AM
    Moderator

All replies

  • You don't want to change Permissions.vb because that is a generated file. Any changes you make there will be tossed away during the next regeneration of the file (such as a clean build).

    I would recommend using the editor in the project properties to change the permission names. It will use refactoring to update your code and update all other files where permission information is stored. I think you'll find it much harder to try to figure out which files you need to update instead of using the designer.


    Justin Anderson, LightSwitch Development Team

    • Proposed as answer by Paul Van Bladel Tuesday, September 17, 2013 7:17 AM
    • Marked as answer by Angie Xu Thursday, October 10, 2013 8:18 AM
    Tuesday, September 17, 2013 3:15 AM
    Moderator
  • Hi Justin,

    thanks for the answer. If the permission-editor in the project-properties is the only thing we have, it think it could be improved.

    Consider the way we work (I myself and I guess some others too:). In the beginning we have few entities, and few permissions (for testing purposes). But during the development of the program it grows and we must create more and more entities, we also rename the entities, we delete some entities and create new ones. During development the permission-thing is not the most important part, so working on permissions comes at last. now in the end the permissions-situation is disastrous. in this situation it would be better to delete every permission, and start to create new permissions, also creating all the "user.HasPermission"-functions, this results in a massive amount of stupid work.

    for every entity we need to have at least 4 permissions: e.g. PersonRead, PersonCreate, PersonEdit, PersonDelete

    I could imagine a Lightswitch-tool or wizard that creates all permissions and the according HasPermission-functions automatically.

    what would you say?

    regards

    Oliver

    Tuesday, September 17, 2013 10:21 AM
  • I would say that I don't disagree (but I'm not sure I entirely agree) with you and the situation you have, but only described why it's still easier to use the existing designer compared to trying to determine what assortment of files need to be updated and, more than likely, messing up your project.

    You should submit a suggestion on the Visual Studio UserVoice site for the LightSwitch category to address this.


    Justin Anderson, LightSwitch Development Team

    • Marked as answer by OlimilO Wednesday, September 18, 2013 9:59 AM
    Tuesday, September 17, 2013 10:31 AM
    Moderator