Re: Forbidden: You don't have permission to access Admin Console.

  •  04-21-2008, 6:06 PM

    Re: Forbidden: You don't have permission to access Admin Console.

    Hi Adam,
     
    Thank you for the prompt reply. Unfortunately, I'm still getting the same problem. It is detecting whether I am logged in fine, it's just not giving me admin privledges.
     
    Code pasted below for your reference:
     
    Imports System.Configuration
    Imports System.Web
    Imports System.Web.Security
    Imports CuteChat

    Public Class CuteChatMembership
        Inherits CuteChat.ChatProvider

        Public Overrides Function GetConnectionString() As String
            Return ConfigurationManager.ConnectionStrings("CuteChat").ConnectionString
        End Function

        Public Overrides Function FindUserLoginName(ByVal nickName As String) As String
            Return HttpContext.Current.User.Identity.Name
        End Function

        Public Overrides Function GetLogonIdentity() As AppChatIdentity
            'need to find the information of current user. Return null if user is anonymous.
            Dim thisUser As New LoggedInUser(HttpContext.Current.User.Identity.Name)
            If thisUser.LoggedIn Then
                Return New AppChatIdentity(HttpContext.Current.User.Identity.Name, False, thisUser.AccountID, HttpContext.Current.Request.UserHostAddress)
            Else
                Return Nothing
            End If
        End Function

        Public Overrides Function GetUserInfo(ByVal loginName As String, ByRef nickName As String, ByRef isAdmin As Boolean) As Boolean
            If Not HttpContext.Current.Request.IsAuthenticated Then
                Return False
            End If
            isAdmin = True
            nickName = loginName
            Return True
        End Function
        Public Overrides Function ValidateUser(ByVal loginName As String, ByVal password As String) As Boolean
            Dim objAccount As New Techflare.Mongoose.Core.Account
            If objAccount.Login(loginName, password, String.Empty) Then
                FormsAuthentication.SetAuthCookie(loginName, False)
                FormsAuthentication.GetRedirectUrl(loginName, False)
                Return True
            Else
                Return False
            End If
        End Function
    End Class

View Complete Thread