This discussion is archived
1 Reply Latest reply: Jun 19, 2013 6:03 AM by linkin RSS

access to the end user depending on user type

993b5db0-e9c6-44a5-8fc3-36a1f7eb96c8 Newbie
Currently Being Moderated

Hi,

I am struck with my design, I have a scenario where end user can access the some operations and privileged operation depending open the end user type.

How to extract the operation from end user and how I can provide the access to privileged operations to end user.

May be I can use the end user type, and I may have to use fassade and delegate patterns.

Let say I have Operation class having methods

Method1, method2, method3 and privileged methods method4, method5

Explain with an example will appreciated

Regards

  • 1. Re: access to the end user depending on user type
    linkin Newbie
    Currently Being Moderated

    yes, façade design pattern is one of the choice in this scenario.

     

    class DefaultUser implements BaseUser{
    ......    
          public void method1(){};
         public void method2(){};    
    }
    class AdminUser extends DefaultUser{
    ......    
          public void method3(){};
         public void method4(){};    
    }
    class SuperAdminUser extends AdmnUser{
    ......    
          public void method5(){};
         public void method6(){};    
    }

    Here three type of user

    1. Default

    2. Admin

    3. SuperAdmin

     

    SuperAdmin have all the accessibility . Admin have the accessibility of method of self & DefaultUser. Default user can only access its own method.

    So this the way you can restrict the user accessibility.

     

    Message was edited by: linkin