使用者、角色、資源和授權組件

來源:互聯網
上載者:User

這段時間園子裡挺多個講這個東西,所以在完善架構的同時編寫的這樣一個組件;架構和該組件都是開源遵循Apache License 2.0 。話不多說了主要介紹一個這個組件,功能並沒有太複雜只是把使用者、角色、資源和授權幾個資料進行一整合處理。對於授權並沒有複雜的處理,畢竟實際應用總會有很多的差異,使用者可以根據自己的需要進行二次擴充。

資料結構圖:

 

組件和應用結構圖:

 

代碼結構簡介:

  • 邏輯代碼:

         public IList<Owner> RoleListInUser(string userid)
        {
            IList<Owner> result = new List<Owner>();
            Expression exp = Role.roleID.In(RoleLinkUser.roleID, RoleLinkUser.userID == userid);
            foreach (Role item in exp.List<Role>())
            {
                result.Add(Owner.Parse(item));
            }
            return result;

        }

  •  Flex代理方法代碼:

  package Api
  {
      import Core.Utility;
      /**
      * Action Script調用方法產生工具1.0  產生時間:2009-6-20 9:29:03
      */
      public dynamic class PermissionServices_RoleListInUser
      {
          public var Callback:Function;
          public var userid:Object;
          public function Execute(method:String="get"):void
          {
              this._TimeSlice = new Date();
              Utility.CallMethod("PermissionServices_RoleListInUser",this,Callback,method);
          }
      }
  }

 應用:

 

 

 

 

源碼下載和示範

http://www.nbao.net

 

 

 

 

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.