2012-10-03 35 views
1

我有一個自定義屬性,我想呈現不同的用戶權限..我的問題是,我不知道如何獲得登錄用戶的權限..並提到我的「上下文」是不是在頁面內,它的自定義屬性..獲取登錄用戶的所有權限,EPiServer

我將如何獲得當前用戶的權限?

在此先感謝!

回答

1

退房Access Control List班。

if (CurrentPage.ACL.QueryDistinctAccess(EPiServer.Security.AccessLevel.Create)) 
{ 
    // Checks whether the currently logged-on user has 
    // Create permission for the current page. 
} 
+0

的問題是,由於它的自定義屬性的情況下,我想檢查登錄用戶的權限,CurrentPage不存在..如果我已經沒有了解它.. – Inx

+0

如果您從PropertyString繼承,您將擁有CurrentPage。 –