Results 1 to 3 of 3

Thread: Role based secuirty plugin

  1. #1
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default Role based secuirty plugin

    I created a role based security plugin that renders the components based on the users roles.

    It works by looking for a roles property in the configuration object and it will also look at the items for the config object and remove the configuration for the component if the users doesn't have the current permissions.

    You have to initialize the object with what roles the users has.

    Code:
    Ext.ux.secure.roles = ['my', 'user', 'roles'];
    Then to have the render process an object config you do:

    Code:
    Ext.ux.secure.render({roles: ['role1', 'role2']});
    the roles property can either be a list of roles or a single role. The render will also accept an array of config objects.

    The unit test contain a lot of examples on how the render works.

    Here is the github project page: https://github.com/mrh0057/Ext-Secure-Component

  2. #2
    Sencha - Sr Software Engineer mitchellsimoens's Avatar
    Join Date
    Mar 2007
    Location
    Gainesville, FL
    Posts
    39,318
    Vote Rating
    1291
      0  

    Default

    Nice idea. I haven't looked at your code but I have a quick suggestion. When you name a project, you should call it by the class name. And class names should have a descriptive naming convention. Since I develop for both ExtJS and Sencha Touch this is what I do:

    Ext.[ux/plugin].[extjs/st].ClassName

    This is an example:

    Ext.plugin.extjs.Security

    ClassName should be UpperCamelCase.

    Just merely a suggestion.
    Mitchell Simoens @LikelyMitch
    Sencha Inc, Senior Software Engineer
    ________________
    Learn BBCode and use it!

    Check out my GitHub, lots of nice things for Ext JS 4 and Sencha Touch 2
    https://github.com/mitchellsimoens

    Think my support is good? Get more personalized support via a support subscription. https://www.sencha.com/store/

    Need more help with your app? Hire Sencha Services services@sencha.com

    Want to learn Sencha Touch 2? Check out Sencha Touch in Action that is in print!

    When posting code, please use BBCode's CODE tags.

  3. #3
    Ext JS Premium Member
    Join Date
    Mar 2011
    Posts
    3
    Vote Rating
    0
      0  

    Default

    Ext.ux.secure is the instance of the class that handles the security. The name of the class is Ext.ux.SecurityRenderController. The code should work withe sencha touch as well as extjs 3.x and 4.x.

    What should I name it since it works in both sench touch and extjs?

Similar Threads

  1. Replies: 35
    Last Post: 5 Dec 2012, 6:57 AM
  2. A sencha-touch based theme plugin for WordPress: first working alpha
    By sandro.paganotti in forum Sencha Touch 1.x: Examples and Showcases
    Replies: 4
    Last Post: 4 Sep 2010, 6:15 AM
  3. Role-based security and widget visualization
    By KaiWeing in forum Ext GWT: Discussion
    Replies: 2
    Last Post: 2 Jul 2010, 7:03 AM
  4. ExtJS and role based UI
    By Whatty in forum Community Discussion
    Replies: 8
    Last Post: 21 Nov 2009, 5:00 AM
  5. How to dynamically make grid columns editable based on user role?
    By wgpubs in forum Ext 2.x: Help & Discussion
    Replies: 3
    Last Post: 4 Dec 2008, 8:33 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •