1 Reply Latest reply on Sep 26, 2011 12:07 PM by LesBerg

    implementing user/roles in existing app

    LesBerg Level 1

      I've been tasked with implementing roles and users in a pre-existing application that has very limited support for them. I've done this before and I have already implemented the users aspect (pretty painless, actually).

       

      The current problem is implementing roles. I need to implement a system in which roles are used to determine several things:

      • the pages viewable by a given user
      • whether a control on a page is visible
      • whether a control is editable
      • whether a datagrid column is displayable (and likewise printable)

       

      The best way I can think to do this is to create an admin page that creates roles by granting view, edit, and print permission to controls and access to pages (mxml files, modules, and components, etc). 'Non technical' SME Admins will likely have need to change/add roles in the future.

       

      I have several questions regarding this:

       

      • Is there a better way to do this in Flex 3.2 / CF 8? Keep in mind that States atre already in use for other things and managing by adding views doesn't fit the abliity to add/modify roles later, and would at least triple the code base.
      • Is there a way to dynamically generate a list of mxml controls on a page and display them - if so, is it going to be more trouble than jsut coding the lists by hand?
      • I can't upgrade the SDK or make 'drastic' changes (i.e.; spend money)

       

       

      thoughts and ideas?

        • 1. Re: implementing user/roles in existing app
          LesBerg Level 1

          well, after chewing on this for a while, I don't think an autogenerated list of control ID's would be best.

          It would be OK for getting the list of control IDs into a database, but it has the potential to upset the roes if changes are made and not accounted for intentionally. e.g: you add a Delete button and forget to turn it off for a certain group and data was inadvertently removed from the database.

           

          I might add a parse button on an admin page for initial and periodic control ID refresh, but not likely. It wouldn't work after the code is compiled anyway.

           

          I'll do it based on the ID's of specific controls and make adding the controls to the database list a manual process to be done at each iteration. It's not that big of a deal anyway, given that the application's features are mature. the changes being asked for at this time are more about who gets to see what controls and change which fields.