コード例 #1
0
 public virtual bool IsAnyAuthorized()
 {
     return(!this.UserName.IsNullOrEmpty() ||
            ProviderOAuthAccess
            .Any(x => !string.IsNullOrEmpty(x.AccessTokenSecret) &&
                 !string.IsNullOrEmpty(x.AccessToken)));
 }
コード例 #2
0
        public virtual bool IsAuthorized(string provider)
        {
            if (!this.UserName.IsNullOrEmpty())
            {
                return(provider == AuthService.CredentialsProvider ||
                       provider == AuthService.BasicProvider);
            }

            return(ProviderOAuthAccess.Any(x => x.Provider == provider &&
                                           !string.IsNullOrEmpty(x.AccessTokenSecret) &&
                                           !string.IsNullOrEmpty(x.AccessToken)));
        }