Component for Role Based Permissions in Flex

I’ve posted a simple component, called Chimp, for doing role based permissions in Flex through metadata.  You can check it out at: http://code.google.com/p/flexible-chimp/. The quick overview is that you provide Chimp the user’s roles on start-up and then add meta data to the components for filtering what the user can see.

Here are the setup instructions:

1) Download and add the chimp.swc to your project library
2) Add compiler argument to keep necessary metadata:

-locale en_US -keep-as3-metadata+=Protected

3) Load the Chimp in your application. The Chimp must be loaded after role data is available, but before children are added:

Chimp.load(perms);

4) Add metadata to your Flex components:

[Protected(permissions="ROLE_ADMIN",notInPermissionAction="remove",componentId="this")]
[Protected(permissions="ROLE_UPDATE",inPermissionAction="enable",componentId="updateButton")]

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • LinkedIn
  • DZone
  • Facebook
  • Digg
  • del.icio.us
  • Reddit
This entry was posted in Historic. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>