• カテゴリ 開発用メモ の最新配信
  • RSS
  • RDF
  • ATOM

ブログ - XCube_Identity, XCube_Principal と XoopsUser

XCube_Identity, XCube_Principal と XoopsUser

カテゴリ : 
開発用メモ » XCL開発資料
執筆 : 
masa 2008/9/27
XCube_Identity, XCube_Principal はともに抽象クラス?
.NETフレームワークに似ている?

.NETフレームワークのロールベースセキュリティモデルについて

■XCube_Identity
ユーザ名と authenticationType を保持するクラス
・XCube_Identity()
コンストラクタ
・setAuthenticationType()
・getAuthenticationType()
・setName()
・getName()
・isAuthenticated()


■XCube_Principal
Principal は Identity を保持している。
・XCube_Principal(XCube_Identity $identity, String[] $roles)
コンストラクタ
Identity と ロール名文字列配列で初期化される
・getIdentity()
XCube_Identity を得る
・isInRole($rolename)
Principal が ロール名で指定されたロールを持っているか?

------------------------------------------------------------
Legacy_Identity と Legacy_GenericPrincipal は XCLでの実装クラス

■Legacy_Identity extends XCube_Identity
XCLでの ログインユーザの Identity
・Legacy_Identity(&$xoopsUser)
コンストラクタ
・getName()
$xoopsUser->get('uname')
・isAuthenticated()
true

■Legacy_AnonymousIdentity
XCLでの 未ログインユーザの Identity
・isAuthenticated()
false

■Legacy_GenericPrincipal extends XCube_Principal
XCLでの Principal

------------------------------------------------------------


isInRole('Site.Administrator')
isInRole('Site.Owner')
isInRole('Site.RegisteredUser')

isInRole('Module.legacy.Admin')
isInRole('Module.user.Admin')
  • トラックバック (0)
  • 閲覧 (5100)